So I want this script to make it so each time you jump it adds to a leaderboard. I added something where if you have 50 jumps on the leaderboard it will show a gui. It works but when that does that it stops counting how many jumps on the leaderboard please help me fix this. Here is the code:
local plr = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
local debounce = false
local debounce2 = false
local Jumps = game.Players.LocalPlayer.leaderstats
local JumpCounter = script.Parent.Parent.Jumps
local Sound = script.Parent.Parent.Sound
plr.Jumping:Connect(function()
if not debounce then
debounce = true
Jumps.Jumps.Value = Jumps.Jumps.Value + 1
JumpCounter.Text = Jumps.Jumps.Value
if(game.Players.LocalPlayer.leaderstats.Jumps.Value >= 50) then
Sound:Play()
wait(3)
Sound:Destroy()
script.Parent.Parent.Frame.Visible = true
script.Parent.Parent.Frame.Trail1.Visible = true
else
script.Parent.Parent.Frame.Visible = false
script.Parent.Parent.Frame.Trail1.Visible = false
end
debounce = not debounce
end
end)

1 comment
Trying this now.