We need a swep that allows movement and landing on any surface and we can use it instead of the crap jetpack mods for spacebuild we have now.
Shattered Horizons + Spacebuild = Win.
Anyone?
[lua]hook.Add("Move","JetPack",function(pl,mv)
local fwdvel = pl:GetNWVector("jetpack-fwd")
local sidevel = pl:GetNWVector("jetpack-side")
if GetConVarNumber("sv_gravity") == 0 and !pl:IsOnGround() and !pl:KeyDown(IN_JUMP) then
if sidevel == origin then sidevel = pl:GetVelocity() end
if fwdvel == origin then fwdvel = pl:GetVelocity() end
local fwd = pl:GetAimVector()
if pl:KeyDown(IN_FORWARD) then
fwdvel = Vector( math.Approach(fwdvel.x,max_vel * fwd.x,inc),
math.Approach(fwdvel.y,max_vel * fwd.y ,inc),
math.Approach( fwdvel.z, max_vel * fwd.z ,inc) )
elseif pl:KeyDown(IN_BACK) then
fwdvel = Vector( math.Approach(fwdvel.x,max_vel * fwd.x * -1,inc),
math.Approach(fwdvel.y,max_vel * fwd.y * -1,inc),
math.Approach( fwdvel.z, max_vel * fwd.z * -1,inc) )
end
local side = pl:GetRight()
if pl:KeyDown(IN_MOVERIGHT) then
sidevel = Vector( math.Approach(sidevel.x,max_side * side.x,inc),
math.Approach(sidevel.y,max_side * side.y,inc),
math.Approach( sidevel.z, max_side * side.z,inc) )
elseif pl:KeyDown(IN_MOVELEFT) then
sidevel = Vector( math.Approach(sidevel.x,max_side * side.x * -1,inc),
math.Approach(sidevel.y,max_side * side.y * -1,inc),
math.Approach( sidevel.z, -1 * max_side * side.z,inc) )
end
mv:SetVelocity(fwdvel + sidevel)
pl:SetNWVector("jetpack-fwd",fwdvel)
pl:SetNWVector("jetpack-side",sidevel)
elseif sidevel != origin || fwdvel != origin then
sidevel,fwdvel = origin, origin
pl:SetNWVector("jetpack-fwd",fwdvel)
pl:SetNWVector("jetpack-side",sidevel)
end
end)[/lua]
Set gravity to zero. Have fun.
Sorry, you need to Log In to post a reply to this thread.