This used to work previously. Then I tried adding a debounce on, and it didnt work. Instead of researching what was going on, I decided to use values to debounce, a terrible idea. I messed up the script, tried to revert it, and I got an error. Can somebody please help me? This error is probably obvious and i just didn't catch it.
EDIT: I think I know what I did wrong, I just want confirmation. But if I dont get it in a while I'll just try it out and see if it works
EDIT2: I FIGURED IT OUT MYSELF
local WinPart = script.Parent WinPart.Touched:Connect(function(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) local humanoid = hit.Parent:FindFirstChild("Humanoid") if player then local leaderstats = player:FindFirstChild("leaderstats") if leaderstats then local player = game.Players.LocalPlayer local Location = game.Workspace.TeleportLocation player.leaderstats.Wins.Value = player.leaderstats.Wins.Value + 1 hit.Parent.HumanoidRootPart.CFrame = CFrame.new(Location.Position) wait(1) end end end)