Some time ago I found a TTT add-on github that allows for much higher jumps without losing health, it changes the value of SetJumpPower.
The problem is that if a player holds an item in his hand and the round is over, JumpPower does not always return to the default state, There is something like this in the script:
local function ResetJumpEnd()
for k, ply in ipairs(player.GetAll()) do
ply:SetJumpPower(160)
end
end
hook.Add( "TTTEndRound", "ResetEndJumpPower", ResetJumpEnd )
It works once, and once it does not, does anyone know how to do it better?
Try this
local function ResetJumpEnd()
for k, v in pairs(player.GetAll()) do
if IsValid(v) then
v:SetJumpPower(160)
end
end
end
hook.Add( "TTTEndRound", "ResetEndJumpPower", ResetJumpEnd )
local function JumpCheck()
for k, v in pairs(player.GetAll()) do
if IsValid(v) && (v:GetJumpPower() >= 161) then
v:SetJumpPower(160)
end
end
end
hook.Add("TTTPrepareRound", "JumpCheck", JumpCheck )
Sorry, you need to Log In to post a reply to this thread.