Z Velocity

dont laugh at me for this but i did try it

this is part of some code im working on, i want it to lunge me forward in the way im facing once im off the ground, or falling, but users can spam it and it only lunges me in Z direction, any help?

[editline]7th March 2015[/editline]

also, im trying to add it for left and right but only if users double tap, can you guys help with that aswell,

:zoid: im almost at 69 posts


The constructor for a Vector object goes x, y, z. I don’t know what you’re doing there. But if you want to go forward then you should get the normalized vector of the player eye angles. A normal vector is a vector that describes a direction.

So go more something like this
[lua]ply:SetLocalVelocity( ply:EyeAngles():Forward() * 600 )[/lua]

:Forward() converts the eye angles to a normal in the direction the player is facing, and when you multiply by 600 that changes the normal’s magnitude to 600.

thanks but now how can i stop people from spamming it?

2 weeks later:

To answer your question, though. Just do the same thing with the other buttons? Look at what the code actually does, and you will figure out how to do the same thing. Might want to drop the IsOnGround part, and do something with timers or something.

i am trying to make an advanced warfare server because ive seen one before when it was in beta and it went down for a while and i wanna be able to play it

my community gamemode is copyrighted dont even think about it

(User was permabanned for this post ("Not the real MaccyD, just another alt account of TheCodingBoss" - postal))

Yeah this tough guy will take your ass to court and sue you into the stone age over copying an idea that isn’t even his!!