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

How do I fix team change GUI issues? Scripts fail to work after multiple changes.

Asked by 6 years ago
Edited 6 years ago

I cannot for the life of me get my team change GUI to work. First it refused to work at all. It works perfectly fine in Studio, but not in game.

FIRST SCRIPT:

function onButtonClicked() script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 end

script.Parent.MouseButton1Click:connect(onButtonClicked)

SECOND SCRIPT:

function Click(mouse) if script.Parent.Parent.Parent.Parent.Parent:IsInGroup(3832145) then script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Crimson") end end

script.Parent.MouseButton1Click:connect(Click)

I attempted to change from Script to LocalScript which did not work and then back to Script. I attempted putting a wait time before execution. I'm not sure what else to do.

0
Side Note: LocalScript of course, changed the team on my screen, not anyone else's. Also it does not spawn me on the correct spawn. I basically remained on the same team, but on my screen my name is under the corresponding team. If that makes sense. Erik_Johann 0 — 6y
0
You seem to be using the old method. Use the newer one: Parent.Team = game.Teams.(Team name) TreySoWavvy 18 — 6y
2
Use a code block please. Crazycat4360 115 — 6y

Answer this question