Ad
Log in to vote
0

Why isn't my team change script working on a newer game?

Asked by 3 days ago

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)
0
Are you receiving any errors in the output? Vong25 187 — 3d
0
I dont know why, but PhysicalTeam does not seem to fit as a variable, it seems like nothing, I can be wrong though Canturion 6 — 3d
0
yeah, it says attempt to index nil TeamColor TheStarWarsMaster856 16 — 3d
0
Ya, what they said TheStageGuyYT 5 — 2d

Answer this question