• Freeze and unfreeze entity
    5 replies, posted
To do to have this entity was frozen when spawned and when recruited 10 subjects the entity unfreeze . sorry for my english -- code that freeze entity . this means that I will not be able to picked up it with gravity gun. if (self:GetNWInt("ration")==10) then --code that unfreeze entity . this means that I will be able to picked up it with gravity gun end
GM/GravGunPickupAllowed I'm assuming you're trying to restrict a prop from being gravity gunned?
if (self:GetNWInt("ration")==10) then object:EnableMotion( false ) --change the object part to your entity end
if i use this , code dont working . for example: local object self:GetPhysicsObject():EnableMotion(false) if (self:GetNWInt("ration")==10) then self:GetPhysicsObject():EnableMotion(true) end
Where are you calling that? If it's constantly being called you will constantly be enabling/disabling motion. If you set EnableMotion(false) on spawn (call it once) you can add this to either the function that increases ration, or on a think call if (not self:GetPhysicsObject():IsMotionEnabled() and self:GetNWInt("ration") == 10) then self:GetPhysicsObject():EnableMotion(true) end
When a player pushes an entity with his body he defrost, how to detach it? what hook?
Sorry, you need to Log In to post a reply to this thread.