Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years 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? COUNTYL1MITS 312 — 3y
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 — 3y
0
yeah, it says attempt to index nil TeamColor TheStarWarsMaster856 12 — 3y
0
Ya, what they said TheStageGuyYT 19 — 3y

Answer this question