The script is supposed to make the player's team change when the value called "mech" changes. Unfortunately, the player is staying neutral, and is spawning at default spawn! Why is that happening? here is the script
while true do
wait(0.1)
if script.Parent.Parent.MechValue.Value == 1 then
script.Parent.Parent.Parent.Parent.Neutral = false
script.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Institutional white")
print("Picked white")
elseif script.Parent.Parent.MechValue.Value == 2 then
script.Parent.Parent.Parent.Parent.Neutral = false
script.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Medium stone gray")
print("Picked gray")
elseif script.Parent.Parent.MechValue.Value == 3 then
script.Parent.Parent.Parent.Parent.Neutral = false
script.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Really black")
print("Picked black")
end
end
Please help!!! Thank you!!! OUTPUT:Players.Player.PlayerGui.ScreenGui.TextButton.Script:17: 'end' expected (to close 'while' at line 1) near ''

3 comments
Does the script print something and what's its location?
Also, I suggest using elseifs.
its location is inside a screenGUI, inside a textbutton