I have this code:
script.Parent.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("HumanoidRootPart")
if humanoid then
if totalWins < 1 then
totalWins = 1
elseif totalWins == 1 then
totalWins = 0
destroyStages()
wait(3)
generateStages()
end
hit.Parent:LoadCharacter()
hit.Parent.leaderstats.Wins = hit.Parent.leaderstats.Wins + 1
end
end)
Everything in the code is defined but when the player touches the block, none of the stuff happens.

3 comments
add print()s to find out where the code stops then come back
code stops after line 2, error message was that I compared instance and value so I'm pretty sure the issue is that line 4 should say totalWins.Value
I updated it with totalWins.Value and it still stops after line 2.