How do you do it? It looks like its good and it has no errors! Heres the code:
local ting = 0 local Part = script.Parent function onClicked(click) if ting == 0 then ting = 1 local check = click.Parent:FindFirstChild("Humanoid") if check ~= nil then local p = game.Players.LocalPlayer local sstats = game.Players.LocalPlayer.leaderstats if sstats ~= nil then local cash = sstats:findFirstChild("Wins") cash.Value = cash.Value + 1 p:ResetCharacter() wait(7) end end ting = 0 end end Part.ClickDetector.MouseClick:Connect(onClicked)
Your issue is
here the fixed version:
local ting = 0 local Part = script.Parent function onClicked(player) if ting == 0 then if not player then return end ting = 1 local sstats = player:FindFirstChild("leaderstats") if sstats ~= nil then local wins = sstats:FindFirstChild("Wins") local points = sstats:FindFirstChild("Points") if wins then wins.Value += 1 end if points then points.Value += 5 end player:LoadCharacter() wait(7) end ting = 0 end end Part.ClickDetector.MouseClick:Connect(onClicked)