I have a simple script that works fine when in Studio Solo mode, but when on any kind of server (even with just one person), it doesn't work.
script.Parent.MouseButton1Click:connect(function(player) game.Players.LocalPlayer.Character:MoveTo(Vector3.new(-5, 1.89, -61.6)) end)
It just gives the error "attempting to index field 'LocalPlayer' (a nil value)". I have a LocalScript in the StarterGui.
Try this out in a Local Script. Works for me in my game.
script.Parent.MouseButton1Down:connect(function() wait(0.1) game.Players.LocalPlayer.Character:MoveTo(Vector3.new(-5, 1.89, -61.6)) end)
And if adding only a certain team.
player = game.Players.LocalPlayer script.Parent.MouseButton1Down:connect(function() wait(0.1) if player.TeamColor == game.Teams['Citizens'].TeamColor then game.Players.LocalPlayer.Character:MoveTo(Vector3.new(-5, 1.89, -61.6)) end end)