I have a variable inside the player which should change when the player touches the “Win” part but it does not update and causes the code to run until the player stops touching the part.
The print statement returns true
but inside the explorer the variable shows it set to false. This is a server script. I’ve tried making a folder for each player inside ServerStorage as well but the same issue occurs. Same thing if I put it inside leaderstats.
workspace.Map.Win.Trigger.Touched:Connect(function(part)
if part.Parent:FindFirstChildOfClass("Humanoid") then
local player =
game:GetService("Players"):GetPlayerFromCharacter(part.Parent)
if player.wonRound.Value == false then
player.wonRound.Value = true
print(player.wonRound.Value)
player.leaderstats.Wins.Value = player.leaderstats.Wins.Value + 1
startRound()
end
end
end)