[LUA]
function ENT:Think()
if self.did then
local pases = self:GetLocalPos()
local ent = ents.FindInSphere(pases, 100)
for k,v in pairs(ent) do
angless = self:GetAngles()
pases = self:GetLocalPos()
local ptses = pases + angless:Forward() *10
if v.IsMoneyPrinter and self.did then
self.did = false
v:SetAngles(angless)
v:SetPos(ptses)
phys = v:GetPhysicsObject()
constraint.NoCollide( v, self ,0, 0)
const, rope = constraint.Slider( self, v ,0, 0,Vector(1,0,0) , Vector(11,0,0) , 1)
if self:GetPos():Distance(v:GetPos()) > 100 then constraint.RemoveAll(v) self.did = true end
end
end
end
end
[/LUA]
I need to check line 19 always. What can i do?
:suicide:
Ummmmm. What?
I need in checking distance between "self" entity and "v" enitity. If that distance more than 100 units then slider should be removed.
You are making no sense what-so-ever. You already have code to do that:
[QUOTE] if self:GetPos():Distance(v:GetPos()) > 100 then constraint.RemoveAll(v) self.did = true end[/QUOTE]
which removes all constraints.
are you sure?
-snip- stupid me
If it was in fact so, then slider must creating every second and "v" entity must changes it's position and angles to "ptses" and "angless" every second too.
I have already passed this.
[QUOTE=Maxitronix;40150258]If it was in fact so, then slider must creating every second and "v" entity must changes it's position and angles to "ptses" and "angless" every second too.
I have already passed this.[/QUOTE]
You're doing this in the Think hook... its running and creating every Tick.
-_- try to run this code. I know what Think hook. line 5 checks every tick but otherwise no. And stop annoying please. I do not want to humiliate or hurt you
[QUOTE=Maxitronix;40150399]-_- try to run this code. I know what Think hook. line 5 checks every tick but otherwise no. And stop annoying please. I do not want to humiliate or hurt you[/QUOTE]
And your line 19 sets this to true for every tick after this gets called ONCE assuming you did self.did somewhere else to even make this code run. And no, I'm not gonna run a blank entity with only a think statement and magically figure out what it is supposed to do and how.
Good luck getting help, you're gonna need it if you treat people like that.
Thank you very much for help and for dumb rate. When i said "Stop annoying please", i mean stop to be annoyed. Sorry fo bad English and good luck too.
I believe this is what you want:
[lua]
if v.IsMoneyPrinter then
if self.did then
self.did = false
v:SetAngles(angless)
v:SetPos(ptses)
phys = v:GetPhysicsObject()
constraint.NoCollide( v, self ,0, 0)
const, rope = constraint.Slider( self, v ,0, 0,Vector(1,0,0) , Vector(11,0,0) , 1)
else
if self:GetPos():Distance(v:GetPos()) > 100 then constraint.RemoveAll(v) self.did = true end
end
end
[/lua]
Sorry, you need to Log In to post a reply to this thread.