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

Simple Team Change Surface Gui not working? Even though code is right?

Asked by 6 years ago
Edited 6 years ago

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!

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 BouncingBrenda 44 — 6y
0
Tried that already ^ HeComesAt_Night 116 — 6y
0
You used a global variable theCJarmy7 1293 — 6y

Answer this question