I have a team changer GUI that when I click to choose a team it won’t change me to that team but keeps me in neutral. I don’t know what is wrong with the code. Here is the code:
local p = script.Parent.Parent.Parent.Parent.Parent.Name
script.Parent.MouseButton1Click:Connect(function()
game.Players[p].TeamColor = BrickColor.new("Maroon")
game.Workspace[p].Humanoid.Health = 0
script.Parent.Parent.Parent.Enabled = false
end)
It won’t work. Here is a video:
This could be due to how you have your “Teams” set up, the SpawnLocation
TeamColors should match up with what your Team Colors are I believe
i just got a spawn location and went to its properties and made the team color the same one for the raider teams
Furkan5E
(Furkan5E)
May 10, 2021, 4:01pm
#4
check if neutral property is ticked on the spawn, if it is untick it.
nope. the raider spawn is not ticked.
Furkan5E
(Furkan5E)
May 10, 2021, 4:03pm
#6
can you show me the properties of you raider spawn?
The color of the spawn is normal white but the team color property is maroon? Is that a problem?
Furkan5E
(Furkan5E)
May 10, 2021, 4:05pm
#8
anything in the output? no the colour of the spawn is not the problem. check if your other spawns have neutral ticked.
I removed the unused spawns and only kept the raider and neutral spawn. It still doesn’t work
Furkan5E
(Furkan5E)
May 10, 2021, 4:06pm
#10
Parent.Name, remove name and try.
Players.ForgottenDogYT.PlayerGui.TeamGUI.Frame.RaiderButton.Script:4: invalid argument #2 (string expected, got Instance)
Error message
Furkan5E
(Furkan5E)
May 10, 2021, 4:08pm
#12
never mind add name back, my mistake.
1 Like
I added it back. No error but still doesn’t work
Furkan5E
(Furkan5E)
May 10, 2021, 4:13pm
#14
I am guessing this is a local script, right?
Its a normal script. Its not a local script
Furkan5E
(Furkan5E)
May 10, 2021, 4:14pm
#16
Pretty sure it has to be a local script
well. I changed it to a local script and it still wont change the teams
Furkan5E
(Furkan5E)
May 10, 2021, 4:19pm
#18
I think I know, give me a second please.
1 Like
Furkan5E
(Furkan5E)
May 10, 2021, 4:24pm
#19
So basically you cant change a player’s team from the client, you can only change it from the server.
so how can I do it for it to work?