when I play my game as a test everything work great, but when I play it as a regular player in roblox I get this error happen. It says
"attempt to index field 'LocalPlayer' (a nail value)"
This is my code
if game.Players.LocalPlayer.Team == game.Teams.Offence then
KingTouch = 9 print(KingTouch)
end
Thank You to whoever helps me!
Make sure you replace the LocalScript with a Server Script (the regular one), and write the following:
game.Players.PlayerAdded:connect(function(player) repeat wait() until player if player.Team == game.Teams.Offence then KingTouch = 9 print(KingTouch) end end)
If it works, please mark as the correct answer!
As always, good scripting!