Sometimes it works, sometimes it completely fails....there are no errors in output please help.
local Player = game.Players.LocalPlayer
while not Player.Character do
wait()
end
local character = Player.Character
local mouse = Player:GetMouse()
local humanoid = character:WaitForChild("Humanoid")
local torso = character:WaitForChild("Torso")
local head = character:WaitForChild("Head")
local debounce = true
local ValueStorage = Player:WaitForChild("ValueStorage")
local Stamina = character:WaitForChild("Stamina")
game:GetService("UserInputService").InputBegan:connect(function(key)
if key.KeyCode == Enum.KeyCode.Space then
if humanoid.Jump == true then
if debounce == false then
return
end
debounce = false
local torso = character:FindFirstChild("Torso")
if torso and Stamina.Value >= 50 then
torso.Velocity = Vector3.new(torso.Velocity.X, humanoid.JumpPower * 1.3, torso.Velocity.Z)
Stamina.Value = Stamina.Value - 50
end
end
repeat wait() until humanoid.Jump == false or humanoid:GetState() == Enum.HumanoidStateType.Landed
wait(0.2)
debounce = true
end
end)
