Working on a skip stage for my obby. Let's say player A has used his 3 skips, but when he dies, he gets the 3 skips back without waiting 2 minutes to get new skip. I'm using a local script.
local player = game.Players.LocalPlayer
local stage = player:WaitForChild("leaderstats"):FindFirstChild("Stage")
local skipped = player:WaitForChild("leaderstats"):FindFirstChild("StageSkipped")
local skipLimit = player:WaitForChild("Skip")
local originalLimit = 3
script.Parent.Text = "Skip Stage: ("..originalLimit + skipLimit.Value..")"
script.Parent.MouseButton1Click:Connect(function()
if originalLimit ~= 0 then
originalLimit = originalLimit - 1
stage.Value = stage.Value + 1
skipped.Value = skipped.Value + 1
script.Parent.Text = "Skip Stage: ("..originalLimit + skipLimit.Value..") "
if player ~= nil and player.Character ~= nil and player.Character:FindFirstChild("Humanoid").Health > 0 then
player.Character.HumanoidRootPart.CFrame = game.Workspace.CheckPoints:FindFirstChild(stage.Value).CFrame + Vector3.new(0,3,0)
end
elseif originalLimit == 0 and skipLimit.Value ~= 0 then
skipLimit.Value = skipLimit.Value - 1
stage.Value = stage.Value + 1
skipped.Value = skipped.Value + 1
script.Parent.Text = "Skip Stage: ("..originalLimit + skipLimit.Value..") "
if player ~= nil and player.Character ~= nil and player.Character:FindFirstChild("Humanoid").Health > 0 then
player.Character.HumanoidRootPart.CFrame = game.Workspace.CheckPoints:FindFirstChild(stage.Value).CFrame + Vector3.new(0,3,0)
end
end
end)
while wait(120) do --120 means 2 minutes
if originalLimit < 3 then --if the originalLimit variable is less then 3 it will add 1 to it every 2 minutes
originalLimit = originalLimit + 1
script.Parent.Text = "Skip Stage: ("..originalLimit + skipLimit.Value..") "
end
end
Any help or suggestions would be great! Thanks!

10 comments
hum:Died is not a valid member of humanoid? wot
oh wait
ok there
and yeah the : is pretty much causes the error and i fixed it using the .died:connect(function() because it is a event
tried that... doesnt work lmao
ok so what is the problem
1 there is no problem, and yeah you may have to wait and yeah i tested this ingame due to studio being non-responsive when i test
and yeah don't forget to reset
nvm now it did type wrongly.. my bad
i am just gonna continue with making a sphere generator from a event