TinpotOps
|
  |
| Joined: 22 Jul 2012 |
| Total Posts: 813 |
|
|
| 22 Oct 2012 02:53 PM |
Script Isn't giving out an error, Trying to get it to Change a team to the specific person if they're in the group and have pressed the button:
script: script.Parent.MouseButton1Down:connect(function() if game.Players.LocalPlayer:IsInGroup(327807) then game.Players.LocalPlayer.TeamColor = BrickColor.new("Bright yellow") end end) |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 22 Oct 2012 02:56 PM |
script.Parent.MouseButton1Down:connect(function() --gui? if game.Players.LocalPlayer:IsInGroup(327807) then game.Players.LocalPlayer.TeamColor = "Bright yellow" --hmm maybe? end end) |
|
|
| Report Abuse |
|
|
TinpotOps
|
  |
| Joined: 22 Jul 2012 |
| Total Posts: 813 |
|
|
| 22 Oct 2012 02:58 PM |
| Needs brickcolor.new, just saying "bright yellow" gives a #3 error, with a brickcolor expected, instead of a string. yes it's a GUI. |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 22 Oct 2012 03:01 PM |
| Could I see your hierarchy? |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 22 Oct 2012 03:01 PM |
| Why not access the player with their playergui? |
|
|
| Report Abuse |
|
|
TinpotOps
|
  |
| Joined: 22 Jul 2012 |
| Total Posts: 813 |
|
|
| 22 Oct 2012 03:03 PM |
@Xnite:
Players: (Players) -TinpotOps(Player) --PlayerGui(PlayerGui) ---ChangeT(ScreenGui) ----ButtonH(Frame) -----TGI(TextButton) ------TGI (Script) |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 22 Oct 2012 03:04 PM |
script.Parent.MouseButton1Down:connect(function() if script.Parent.Parent.Parent.Parent.Parent:IsInGroup(327807) then script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Bright yellow") end end)
Check the parents. |
|
|
| Report Abuse |
|
|
TinpotOps
|
  |
| Joined: 22 Jul 2012 |
| Total Posts: 813 |
|
|
| 22 Oct 2012 03:07 PM |
| No errors in Output, Parents are correct, are you able to execute the IsInGroup method from the Players tab? |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 22 Oct 2012 03:11 PM |
were is this script located again?
waht's the parent of this script? |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2012 03:11 PM |
@miz
If this is in a LocalScript then like the original script, you only need to use the LocalPlayer object in Players.
@tin
Is it definitely in a localscript? |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 22 Oct 2012 03:11 PM |
-TinpotOps(Player) --PlayerGui(PlayerGui) ---ChangeT(ScreenGui) ----ButtonH(Frame) -----TGI(TextButton) ------TGI (Script)
script.Parent.Parent.Parent.Parent.ChangeT.ButtonH.TGI.MouseButton1Down:connect(function() if script.Parent.Parent.Parent.Parent.Parent.Parent:IsInGroup(int) then script.Parent.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("TeamColor") end end)
Change the parents
Change the int to the Group
Change TeamColor to the BrickColor
|
|
|
| Report Abuse |
|
|
TinpotOps
|
  |
| Joined: 22 Jul 2012 |
| Total Posts: 813 |
|
| |
|
|
| 22 Oct 2012 03:19 PM |
@miz
I'm sorry, please do not be too offended, but it has to be said before you ruin someone's scripting abilities:
You are giving horrible information. You single-handedly made that script about 5 times less efficient by messing with the hierarchy.
If you are using a *LOCAL*Script, then you can access the player it is in by referencing game.Players.LocalPlayer.
Therefore, you are making it more complicated and making the code more prone-to-error.
Please cease until you know somewhat what you are talking about. You seem new to the concept. |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 22 Oct 2012 03:22 PM |
int = 327807 script.Parent.MouseButton1Down:connect(function() if LocalPlayer:IsInGroup(int) then --local player or five parents huh? LocalPlayer.TeamColor = BrickColor.new("Bright yellow") end end) |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2012 03:25 PM |
@Xnite LocalPlayer doesn't exist, you need game.Players.LocalPlayer
@Tin
Apart from fixing the incorrect renditions of your script by other people, I cannot see a problem with yours.
However I remember having issues with TeamColors myself. Is this possibly a logical error rather than a syntax error? |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 22 Oct 2012 03:27 PM |
Ugh I knew something was wrong.
int = 327807 script.Parent.MouseButton1Down:connect(function() if game.Players.LocalPlayer:IsInGroup(int) then --local player or five parents huh? game.Players.LocalPlayer.TeamColor = BrickColor.new("Bright yellow") end end)
or or
int = 327807 script.Parent.MouseButton1Down:connect(function() if script.Parent.Parent.Parent.Parent.Parent:IsInGroup(int) then --local player or five parents huh? script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Bright yellow") end end) |
|
|
| Report Abuse |
|
|