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

How do you refresh all of the players in the game?

I was wondering how to refresh all the players in the game like Murder Mystery 2 does at the end of the round.

Player:LoadCharacter()

^ I'm not sure if this is relevant, but this is as far as I can get.

The script that I've been trying to put that in. below


if #_G.gameplayers == 1 then

	for i, v in pairs (_G.gameplayers) do

		if v ~= nil then

			status.Value = v..' Is The WINNER!'

			print 'Game Over!'

			game.Players[v].leaderstats.Wins.Value = game.Players[v].leaderstats.Wins.Value + 1

			game.Players[v].leaderstats.Rating.Value = game.Players[v].leaderstats.Rating.Value + 4
			
			print 'Gave winning player point!'

			break
	end

break

else

	status.Value = i..' seconds left!'
end

end

I've been trying to implement a refresh script to refresh the winner of the round. What I've done doesn't seem to work. Thank You!

EDIT: Sorry, I didn't clarify that I didn't want to kill the player.

2 answers

✓ Accepted answer

http://robloxdev.com/articles/Resetting

-- Use in a Local Script --
repeat wait(0.03) until game.Players.LocalPlayer.Character
game.Players.LocalPlayer.Character:BreakJoints() --Effectively kills the player

3 comments

0

and use player added to do the stat portion

0

How do you refresh the character without killing?

I mean this probably isn’t ideal at all but you could do FireAllClients, then from each client do FireServer to change the leaderstats for the client, and since all clients are firing then it would change everyone’s leaderstats

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