- Initiateur de la discussion
S
snaps
Geek
- Messages
- 13
- Score réaction
- 0
- Points
- 65
Voila j'aimerais bien qu'il n'y pas de limite de vitesse lorsqu'on fait du bunny hop dans mon serveur deathrun.
Il me semble que c'est cette partie du code qu'il faut changer mais je sais pas exactement quoi
function GM:Move(pl, movedata)
if pl:IsOnGround() or !pl:Alive() or pl:WaterLevel() > 0 then return end
local aim = movedata:GetMoveAngles()
local forward, right = aim:Forward(), aim:Right()
local fmove = movedata:GetForwardSpeed()
local smove = movedata:GetSideSpeed()
forward.z, right.z = 0,0
forward:Normalize()
right:Normalize()
local wishvel = forward * fmove + right * smove
wishvel.z = 0
local wishspeed = wishvel:Length()
if(wishspeed > movedata:GetMaxSpeed()) then
wishvel = wishvel * (movedata:GetMaxSpeed()/wishspeed)
wishspeed = movedata:GetMaxSpeed()
end
local wishspd = wishspeed
wishspd = math.Clamp(wishspd, 0, 30)
local wishdir = wishvel:GetNormal()
local current = movedata:GetVelocity()ot(wishdir)
local addspeed = wishspd - current
if(addspeed <= 0) then return end
local accelspeed = (120) * wishspeed * FrameTime()
if(accelspeed > addspeed) then
accelspeed = addspeed
end
local vel = movedata:GetVelocity()
vel = vel + (wishdir * accelspeed)
movedata:SetVelocity(vel)
return false
end
Il me semble que c'est cette partie du code qu'il faut changer mais je sais pas exactement quoi
function GM:Move(pl, movedata)
if pl:IsOnGround() or !pl:Alive() or pl:WaterLevel() > 0 then return end
local aim = movedata:GetMoveAngles()
local forward, right = aim:Forward(), aim:Right()
local fmove = movedata:GetForwardSpeed()
local smove = movedata:GetSideSpeed()
forward.z, right.z = 0,0
forward:Normalize()
right:Normalize()
local wishvel = forward * fmove + right * smove
wishvel.z = 0
local wishspeed = wishvel:Length()
if(wishspeed > movedata:GetMaxSpeed()) then
wishvel = wishvel * (movedata:GetMaxSpeed()/wishspeed)
wishspeed = movedata:GetMaxSpeed()
end
local wishspd = wishspeed
wishspd = math.Clamp(wishspd, 0, 30)
local wishdir = wishvel:GetNormal()
local current = movedata:GetVelocity()ot(wishdir)
local addspeed = wishspd - current
if(addspeed <= 0) then return end
local accelspeed = (120) * wishspeed * FrameTime()
if(accelspeed > addspeed) then
accelspeed = addspeed
end
local vel = movedata:GetVelocity()
vel = vel + (wishdir * accelspeed)
movedata:SetVelocity(vel)
return false
end