I have this team change gui, it worked in my older game but for some reason it doesn't now, with the same script.

LOCAL SCRIPT

BU.MouseButton1Click:Connect(function()
	sound:Play()
	game.ReplicatedStorage.ChangeTeamEvent:FireServer(script.Parent.Name)
	workspace.Theme:Stop()
	workspace.Main:Play()
	Camera.CameraType = Enum.CameraType.Custom
	gui.Enabled = false
end)

SERVER SCRIPT

local Teams = game:GetService("Teams")

game.ReplicatedStorage.ChangeTeamEvent.OnServerEvent:Connect(function(Player, Team)
	local PhysicalTeam = game.Teams:FindFirstChild(Team).TeamColor
	Player.TeamColor = PhysicalTeam
	Player:LoadCharacter()
end)

5 comments

0

Are you receiving any errors in the output?

0

I dont know why, but PhysicalTeam does not seem to fit as a variable, it seems like nothing, I can be wrong though

0

yeah, it says attempt to index nil TeamColor

0

Ya, what they said