How can i do a timer + hit ent? it's for empty crate.
4 replies, posted
[CODE]
function ENT:StartTouch(hitEnt)
if hitEnt:IsValid() and hitEnt:GetClass() == "spawned_weapon" then
for k,v in pairs(CustomShipments) do
if v.entity == hitEnt:GetTable().weaponclass then
if self.settype == true then
if self.Entity.dt.contents == k then
else
//Not the same
return
end
else
self.settype = true
end
self.Entity.dt.contents = k
self.Entity.dt.count = self.Entity.dt.count + 1
hitEnt:Remove()
break
end
end
end
end[/CODE]
I need help with this i want the weapon join to the shipment (this do okey) but this is so fast so i cant grab the weapon i was thinking in give a timer for like 5 seconds but i dont know how to do it, i try with simple.timer and create.timer but dont work help.
- Sorry for my english!
[code]if ( hitEnt:GetCreationTime( ) - CurTime( ) ) > 5 then
self.dt.contents = k
self.dt.count = self.dt.count + 1
hitEnt:Remove( )
end[/code]
That might do what you want.
Thanks but i think is bugged with the curtime cuz dont work
I got my order backwards:
[code]if ( CurTime( ) - hitEnt:GetCreationTime( ) ) > 5 then[/code]
It was always <= 0 so nothing was going to happen.
[QUOTE=Kogitsune;41434823]I got my order backwards:
[code]if ( CurTime( ) - hitEnt:GetCreationTime( ) ) > 5 then[/code]
It was always <= 0 so nothing was going to happen.[/QUOTE]
Good Job Man <3 Solved
Sorry, you need to Log In to post a reply to this thread.