|
| 15 Jul 2013 05:21 PM |
function Click(mouse) if script.Parent.Parent.Parent.Parent.Parent:IsInGroup(13783) then script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Light blue") end end
script.Parent.MouseButton1Click:connect(Click)
I want it so that a specific group rank is able to get on this team and nobody else, how would I do that?
It is something on the lines of Parent:Isingroup(#) localrank = 18
Help? |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
|
| 15 Jul 2013 05:36 PM |
| Yes, but my question is how to have it at a specific rank, like so only specific ranks can be on that team. |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2013 05:36 PM |
| You need to do CheckIfInGroup |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2013 05:39 PM |
| How would I do that, I'm unsure with this. |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
sam8985
|
  |
| Joined: 12 Nov 2011 |
| Total Posts: 582 |
|
|
| 15 Jul 2013 05:50 PM |
function Click(mouse) if script.Parent.Parent.Parent.Parent.Parent:IsInGroup(13783) then if script.Parent.Parent.Parent.Parent.Parent:GetRankInGroup(13783) > 18 then script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Light blue") end end end script.Parent.MouseButton1Click:connect(Click) |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
sam8985
|
  |
| Joined: 12 Nov 2011 |
| Total Posts: 582 |
|
| |
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
sam8985
|
  |
| Joined: 12 Nov 2011 |
| Total Posts: 582 |
|
| |
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
| |
|
|
| 15 Jul 2013 07:49 PM |
script.Parent.MouseButton1Click:connect(function(mouse) if game.Players.LocalPlayer:IsInGroup(13783) and game.Players.LocalPlayer:GetRankInGroup(13783) > 100 then game.Players.LocalPlayer.TeamColor = BrickColor.new("Light blue") end end)
You need to make this a LocalScript because; a. It uses LocalPlayer. b. It doesn't cache if the user is in the group or not.
Also you wanted Player:GetRankInGroup, Role is the number next to the description of the role, the number between 0-255.
Felt like making it more efficient too.
|
|
|
| Report Abuse |
|
|
sam8985
|
  |
| Joined: 12 Nov 2011 |
| Total Posts: 582 |
|
|
| 15 Jul 2013 08:01 PM |
We USED GetRankInGroup... And it can't be a LocalScript, nub. It's in a GUI. |
|
|
| Report Abuse |
|
|
| |
|
|
| 15 Jul 2013 08:04 PM |
>And it can't be a LocalScript, nub. It's in a GUI. Yes it can., and gui's are already local considering their in PlayerGui
>It can be a localscript. With my script it must be or it'll error, I'm using LocalPlayer, a local resource. |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2013 08:11 PM |
@baheeg '2.How is "TeamColor" = "BrickColor"? you cant incompare them' Research a little on the wiki before providing false information please.
TeamColor and BrickColor essentially are the same value types. |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2013 08:11 PM |
| TeamColor is a BrickColor value. |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|