Hey gamers, I’ve been trying to fix this for a long time but haven’t been able to find a solution.
For some reason, I get an error at line 5; Players.Fox_2042.PlayerGui.Menu.Buttons.Play.Click:5: attempt to index nil with 'Team'.
I don’t know what I can do to make the game recognize the local player. Nothing I try works.
Here’s the scipt.
local plr = game:GetService("Players").LocalPlayer
script.Parent.MouseButton1Click:Connect(function(plr)
plr.Team = script.Parent.Parent.SelectedTeam.Value
plr:LoadCharacter()
end)
Well the LocalPlayer property does not exist on the server for fairly obvious reasons (because it’s the server…) so there’s no point in trying this with a normal Script, try debugging with a LocalScript