|
| 27 Nov 2015 04:46 PM |
I'm trying to make a script to where 2 buttons show up whenever a player's team changes to "Really red" and then go invisible whenever it's turned to a different team. There's no errors but the guis don't become visible :(
game.StarterGui.ResetPlayerGuiOnSpawn = false
local Player = script.Parent.Parent.Parent
Player.Changed:connect(function(Property) if Property == "TeamColor" and Player.TeamColor == BrickColor.new"Really red" then for _,x in pairs(script.Parent:GetChildren()) do if x.ClassName ~= "Script" then x.Visible = true end end else for _,x in pairs(script.Parent:GetChildren()) do if x.ClassName ~= "Script" then x.Visible = false end end end end) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 27 Nov 2015 05:43 PM |
game.StarterGui.ResetPlayerGuiOnSpawn = false
local Player = script.Parent.Parent.Parent
Player.Changed:connect(function(Property) if Property == "TeamColor" and Player.TeamColor == BrickColor.new"Really red" then print("They're on the Really red team!") for _,x in pairs(script.Parent:GetChildren()) do if x.ClassName ~= "Script" then x.Visible = true end end else print("Nope, they're on the "..Player.TeamColor.." team") for _,x in pairs(script.Parent:GetChildren()) do if x.ClassName ~= "Script" then x.Visible = false end end end end) ========================== Run this script instead and check the Output. |
|
|
| Report Abuse |
|
|
| |
|
|
| 27 Nov 2015 05:50 PM |
Players.WentLimited.PlayerGUI.DJTeleportation.Script: 12: attempt to concatenate field 'TeamColor' (a userdata value)
line 12 has a problem |
|
|
| Report Abuse |
|
|
| |
|
|
| 27 Nov 2015 05:52 PM |
| Lol that error was my fault, whoopsies |
|
|
| Report Abuse |
|
|
|
| 27 Nov 2015 05:53 PM |
| Also it doesnt work. Still doesnt show up |
|
|
| Report Abuse |
|
|