wsd906
|
  |
| Joined: 27 Jan 2009 |
| Total Posts: 9880 |
|
|
| 20 Dec 2012 03:01 PM |
Alright, I am making this GUI that will allow you to change teams based on your rank in a group. For some reason it isnt changing your spawns, im pretty sure I have all the spawns and everything set up and I know its this script that is doing it because it exceutes the other part. Anyways, here it is:
player = script.Parent.Parent.Parent.Parent
function Click(mouse) if player:GetRankInGroup(734737) == 254 then player.TeamColor = BrickColor.new("Dark green") end end
script.Parent.MouseButton1Down:connect(Click)
Please help! |
|
|
| Report Abuse |
|
|
wsd906
|
  |
| Joined: 27 Jan 2009 |
| Total Posts: 9880 |
|
| |
|
crouton04
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 4459 |
|
|
| 20 Dec 2012 03:33 PM |
function Click() if player:GetRankInGroup(734737) == 254 then -- why not use GetRoleInGroup and then the string name. player.TeamColor = BrickColor.new("Dark green") end end
script.Parent.MouseButton1Down:connect(Click)
Fixed |
|
|
| Report Abuse |
|
|
wsd906
|
  |
| Joined: 27 Jan 2009 |
| Total Posts: 9880 |
|
|
| 20 Dec 2012 04:17 PM |
| Can you show me that? Not quite sure what your trying to say. |
|
|
| Report Abuse |
|
|
|
| 20 Dec 2012 04:18 PM |
GetRoleInGroup() returns a string with the player's rank
¤ † KMXD† ¤ |
|
|
| Report Abuse |
|
|
|
| 20 Dec 2012 04:18 PM |
role = "Super l33t admin"
function Click() if player:GetRoleInGroup(734737) == role then -- why not use GetRoleInGroup and then the string name. player.TeamColor = BrickColor.new("Dark green") end end
script.Parent.MouseButton1Down:connect(Click) |
|
|
| Report Abuse |
|
|
|
| 20 Dec 2012 04:19 PM |
Also, player is not defined. I'd recommend using a localscript + localplayer because it would be easier, and I don't know your hierarchy.
¤ † KMXD† ¤ |
|
|
| Report Abuse |
|
|
wsd906
|
  |
| Joined: 27 Jan 2009 |
| Total Posts: 9880 |
|
|
| 20 Dec 2012 04:31 PM |
Ok, well as you probably noticed, I am a rookie scripter. I took the script added on here and heres what it looks like now:
player = script.Parent.Parent.Parent.Parent
role = "President & Premier"
function Click() if player:GetRoleInGroup(734737) == role then player.TeamColor = BrickColor.new("Dark green") end end
script.Parent.MouseButton1Down:connect(Click)
This still isnt working. I have Teams and Spawns all set up, and I cant figure this out. |
|
|
| Report Abuse |
|
|
crouton04
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 4459 |
|
|
| 20 Dec 2012 04:34 PM |
player = script.Parent.Parent.Parent.Parent -- This might be off
role = "President & Premier" -- This has to be the same as the group role.
function Click() if player:GetRoleInGroup(734737) == role then player.TeamColor = BrickColor.new("Dark green")-- You sure it's this color? end end
script.Parent.MouseButton1Down:connect(Click) |
|
|
| Report Abuse |
|
|
wsd906
|
  |
| Joined: 27 Jan 2009 |
| Total Posts: 9880 |
|
|
| 20 Dec 2012 04:39 PM |
I think my variables are off.
The script is within a text button, The text button is within the frame The frame is within a screen GUI And the Screen GUI is within the StarterGUI folder
did I do it right? |
|
|
| Report Abuse |
|
|
crouton04
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 4459 |
|
|
| 20 Dec 2012 04:40 PM |
| player = script.Parent.Parent.Parent.Parent.Parent |
|
|
| Report Abuse |
|
|
|
| 20 Dec 2012 04:42 PM |
OR You put the script in a localscript. Then, you can use:
player = game.Players.LocalPlayer |
|
|
| Report Abuse |
|
|
wsd906
|
  |
| Joined: 27 Jan 2009 |
| Total Posts: 9880 |
|
|
| 20 Dec 2012 04:46 PM |
FINALLY GOT IT. Thank you guys so much, it was because I missed the Parent thing.
God bless all whom delt through my rookiness today :) |
|
|
| Report Abuse |
|
|
|
| 20 Dec 2012 04:54 PM |
| Next time, check and post the output, then we can determine errors much more quickly |
|
|
| Report Abuse |
|
|