Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Intvalue not changing when a player leaves the game?

Hi, i am making a round based game. If everyone is dead the round ends. This also counts if all players leave the game but my intvalue of alive players wont change when a player leaves the game?

game.Players.PlayerRemoving:Connect(function(player)
	local character = player.Character
	if character.IsInRound.Value == true then
	local aliveplayers = game.Workspace.Game.Scripts.AlivePlayers
		aliveplayers.Value = aliveplayers.Value - 1
	end
end)

2 comments

0

Are There Any Errors? And Also Check If The IsInRound Value Is In The Character

0

No errors seen. The value indeed is in the character.

1 answer

✓ Accepted answer

Use print(). No, seriously. Use it.

There is really nothing wrong with your code, but you should definitely use print() for debugging purposes. It will allow you to locate where the problem is and how to solve that problem. If you don't use print() you won't know where the problem lies.

Don't go and shoot yourself in the foot, either. Just print something simple so you know that that code is running.

1 comment

0

Ok, thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.