• Play pos
    4 replies, posted
Quick question, how do I get a player position? I just got Physboom:SetPos(self.player:GetPos()) But I don't think that will work. I just need to set the Physboom to playerpos - 20 on the Z axis. Its probably really simple but I am a terrible coder. Damit Title spelling error
[lua]--serverside player.GetByID(1):GetPos() -- or ply/pl if you are using it in a hook that works with the player as an argument -- clientside LocalPlayer():GetPos() [/lua] returns a Vector().
Also, is there a way to detect that a player is in the air or not on the ground? [editline]03:47PM[/editline] And how do I set it to the pos - 20 on the Z axis?
[url]http://wiki.garrysmod.com/?title=Entity.IsOnGround[/url] and [lua] local vec = pl:GetPos() -- Vector(x,y,z) local newVec = Vector(vec.x, vec.y, vec.z - 20) [/lua]
Is it possible for the Physic Explosion to affect the player? It doesn't work for me. It will affect props but not the player. I am just making a swep that propels he player upward. [editline]05:53PM[/editline] Okay got it to affect players but it hardly does anything. Its more of a nudge than a flying into the air. The magnitude is set to 2000, and the radius is 600. It should be more the enough, but it doesn't work.
Sorry, you need to Log In to post a reply to this thread.