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

Team spawn locations are bugged, help?

Okay, so. I have got these teams:

-Alpha -Beta -Teta -Choosing (Made it AutoAssignable by using a script that when the player joins he gets teamed)

And I made a script to make them change group by being in a group. Here there's the code:

local Player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
    if Player:IsInGroup(---) then 
	local plr = game.Players.LocalPlayer.Name
	Player.Character.Head:remove() --To refresh the player
    game.Players[plr].TeamColor = BrickColor.new("Bright blue")
	Player.PlayerGui.TeamChoose.Frame.Visible = false
    else
	Player.PlayerGui.TeamChoose.Frame.Main.Warning.Visible = true
	wait(3)
	Player.PlayerGui.TeamChoose.Frame.Main.Warning.Visible = false
	    end
end)

So, after doing it and dying. I still respawn in the first team I was in spawn location. What's wrong?

P.S. Yes, all spawn locations are set to neutral = false. And yes, They have got the right team color.

Please help!!!

1 answer

local Player = game.Players.LocalPlayer

script.Parent.MouseButton1Down:Connect(function()
    if Player:IsInGroup(3989888) then 
	    Player.TeamColor = BrickColor.new("Bright blue")
   	 	Player.Character:BreakJoints()
    	--Player.PlayerGui.TeamChoose.Frame.Visible = false
    else
    	--Player.PlayerGui.TeamChoose.Frame.Main.Warning.Visible = true
		print('true')
    	wait(3)
    	--Player.PlayerGui.TeamChoose.Frame.Main.Warning.Visible = false
		print('false')
    end
end)

The above worked fine for me in Studio.

There could be an issue with your group id. If you have anything in your output I'd love to see it.

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