Elimination issue + teleport issue

Hey! I realised what the problem was… It was because the players’ stage wasn’t reseted for the new map, I discovered that putting print(1), print(3) etc in the checkpoints, the new round would begin and the number stayed high and wouldn’t go back to 0, so that’s why…

Do you know how to make the stage number be reseted?

I think I need to write something with “for _, Player in pairs” in the end of the script before the chosen map is destroyed.

Did you set a default value for Stage before the map is chosen

for _, Player in pairs(Players:GetChildren())do
	Player.Team = Contestants
    -- Player.Character.Stage.Value = 0, nil, math.huge, etc.
end

What do you mean? Um I think the default value should be 0, but I didn’t write that… The whole IntValue thing was written by other person and I am still confused how it works, without having something like:

local Stage = ???

I wrote in the end:

for _, Player in pairs(Players:GetChildren())do
for _, player in pairs(Players:GetPlayers()) do
local char = player.Character
if not char then continue end

	local stage = char.Stage.Value
	Player.Stage = 0
	end
end

And there was an error in the output, saying that Stage is not a valid member of Player “Players.Laverr54”

And there was an error in the output, saying that Stage is not a valid member of Player “Players.Laverr54”

so I get what is the error, the error is that char it isn’t the character because if it was char it was gonna
tell you Stage is not a valid member of Player “workspace.Laverr54”

so what you need to do is just do Player.Character

I think so. if not then do what @DaringAwesomeSauce said

1 Like

An IntValue is an instance that contains an integer value.

You can get the value of Stage by doing Stage.Value. In your script you parented it to each player’s character.

Player.Character.Stage.Value = 0

By doing local stage = char.Stage.Value and changing the value of stage, you are only copying the value and changing the copy, not the actual value.

1 Like

Wow thank you so much! It finally works! I thought it was never going to work I’m so happy really thanks for the patience XD

1 Like

Thanks bro you helped me a lot XD

@Laverr54 that’s why I’m here on the forum mostly, to help peoples :slight_smile:

1 Like