Hi everyone I’m working on an Ability Tool thing and my question is how can I add so the Jump function automatically jumps 2 times higher than normal jump when tool is activated(I hope u guys understand me)
local tool = script.Parent
local savedTime = 0
tool.Activated:Connect(function()
if os.time() - savedTime >= 10 then
savedTime = os.time()
end
end)
local tool = script.Parent
local regularJumpHeight = <your regular jump height here>
local toolJumpHeight = regularJumpHeight * 2
tool.Activated:Connect(function(player)
local character = player:WaitForChild("Character") or player.CharacterAdded:Wait()
local humanoid = character.Humanoid
humanoid.JumpHeight = toolJumpHeight
end)
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
humanoid.JumpPower *= 2
local tool = script.Parent
local cooldown = 10 -- 10 seconds
local currentTime = cooldown
tool.Activated:Connect(function()
if tick() - currentTime >= cooldown then
currentTime = tick()
humanoid.Jump = true
end
end)
Yes, but as these changes are only client sided, they don’t get replicated to the server, and as such, having something like an anticheat system in place might just think that you’re trying to manipulate your game.
Having all this done in a server script instead eliminates this problem. And it’s basically the same code, with just a few differences as you can see in my provided script.
They do get replicated to the server, and it’s better to do it on the client too because it’s instant feedback. It’s also a lot easier and just works better imo
Easier because when the player inputs the run button (shift) you can just change the jump/speed directly there, instead of having to send a remote event/function to the server and verify bunch of stuff. A lot easier to code and running is smoother with no delay on input