gogo6104
|
  |
| Joined: 10 Feb 2010 |
| Total Posts: 326 |
|
|
| 06 Nov 2016 12:00 PM |
I made a script that gives a gui to a player on spawning if they're rank 2 or higher in a group, it's working for my player and everyone else won't get it and they're rank 2 or higher ;-;
|
|
|
| Report Abuse |
|
|
he_ro
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 634 |
|
| |
|
gogo6104
|
  |
| Joined: 10 Feb 2010 |
| Total Posts: 326 |
|
|
| 06 Nov 2016 12:04 PM |
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) if game.Players[player.Name]:GetRankInGroup(2957840) >= 2 then script["Example Gui"]:Clone().Parent = player.PlayerGui end end) end)
|
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 06 Nov 2016 12:07 PM |
id = 12341234 -- your group ID rank = 2 -- make sure you are using the correct rank
game.Players.PlayerAdded:connect(function(player) if player:GetRankInGroup(id) > 2 then gui:Clone().Parent = player.PlayerGui end end)
|
|
|
| Report Abuse |
|
|
gogo6104
|
  |
| Joined: 10 Feb 2010 |
| Total Posts: 326 |
|
|
| 06 Nov 2016 12:19 PM |
I don't see how variables can help.
I made a door that puts a uniform on ranks 2 or higher and it works fine, why won't this work... ;-;
|
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 06 Nov 2016 12:21 PM |
Is this a server script in the ServerScriptService, or some other non-local directory like the Workspace? Is it disabled by accident?
|
|
|
| Report Abuse |
|
|
gogo6104
|
  |
| Joined: 10 Feb 2010 |
| Total Posts: 326 |
|
|
| 06 Nov 2016 12:22 PM |
The one for giving gui is in server script service, the door is in workspace. The thing is the gui giver is working for me, and I'm rank 2 in the group, but it won't for others.
|
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 06 Nov 2016 12:28 PM |
I think you are confused about how ranks work, but correct me if I'm wrong. You are actually in the 10th position in the group 2957840, which means you're undoubtedly higher than rank 2, no?
Also, is that your entire script? If it only works for you and not others, perhaps you're moving the gui instead of cloning it, or perhaps your script stops working after it's done its duty once.
|
|
|
| Report Abuse |
|
|
gogo6104
|
  |
| Joined: 10 Feb 2010 |
| Total Posts: 326 |
|
|
| 06 Nov 2016 12:29 PM |
That's not the group ID because I didn't want to give away the actual group I'm developing this for
|
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 06 Nov 2016 12:30 PM |
Ranks in groups go from 0 to 255, 0 being anyone who's not enrolled, iirc.
You are certain that it's truly rank 2 you want?
|
|
|
| Report Abuse |
|
|
gogo6104
|
  |
| Joined: 10 Feb 2010 |
| Total Posts: 326 |
|
|
| 06 Nov 2016 12:31 PM |
Yes, this is confusing because I use the same line for both scripts. It works for the uniform, it doesn't for the gui.
|
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 06 Nov 2016 12:32 PM |
Examine other factors. It is likely not the script if this is the only code in it.
|
|
|
| Report Abuse |
|
|