I am making a laser tag game, and in the beginning your viewing a soldier with a vest and a whiteboard, and the whiteboard lets you choose what game mode you want, but when I click "normal" which is suppose to put you on a team which automatically splits team evenly, wont team me when I click it.

Code:

plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
	plr.TeamColor = game.Teams["_"].TeamColor
	plr.Character.Humanoid.Health = 0
end)

There is no error received in output.

Any advice can help!

3 comments

0

i believe the issue is the fact since a surfacegui is in workspace it wouldn't be able to access localplayer. im not entirely sure but one thing i think you could do would be to do function(player) to grab the player who clicked

0

Tried that already ^

0

You used a global variable