Kondou
|
  |
| Joined: 05 Aug 2012 |
| Total Posts: 1148 |
|
|
| 18 Dec 2012 06:39 AM |
Alright, I'm trying to make a script that will make a GUI visible ONLY to people of a certain rank in a group. Here is what I have so far, it does not produce any errors in output, however it hides the GUI even though I am in the group and of correct rank. PS: Yes, I uploaded it and played it in online mode, where it does not show the GUI
function admin(player, group, role) role = role or "" if player:GetRoleInGroup(group) == role then A=script.Parent.ClanAdmin A.Visible = true else A.Visible = false end end
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char)
admin(player, 723652, "Commander")
end) end) |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2012 07:09 AM |
| Try it in test mode and click on Start Player, check the output and come back with your results |
|
|
| Report Abuse |
|
|
Kondou
|
  |
| Joined: 05 Aug 2012 |
| Total Posts: 1148 |
|
|
| 18 Dec 2012 07:20 AM |
| Nothing comes up on output. |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
| |
|
Kondou
|
  |
| Joined: 05 Aug 2012 |
| Total Posts: 1148 |
|
|
| 18 Dec 2012 07:57 AM |
| Removed it, the script isn't making the GUI disappear when it is visible nor is it making it appear when it is not Visible. |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
|
| 18 Dec 2012 07:59 AM |
| Add a wait after the character add for like 2 secs or something |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2012 08:02 AM |
function admin(player, role) role = role or "" if player:GetRoleInGroup(723652) == role then A=script.Parent.ClanAdmin A.Visible = true else A.Visible = false end end
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function()
admin(player, "Commander")
end) end)
-- Try this... |
|
|
| Report Abuse |
|
|
Kondou
|
  |
| Joined: 05 Aug 2012 |
| Total Posts: 1148 |
|
|
| 18 Dec 2012 10:28 AM |
| You sah, are a god. Second script you helped me make work today. :D |
|
|
| Report Abuse |
|
|
12packkid
|
  |
| Joined: 24 Jun 2011 |
| Total Posts: 1418 |
|
|
| 18 Dec 2012 10:36 AM |
| GetRoleInGroup needs to be GetRoleIsInGroup |
|
|
| Report Abuse |
|
|
Kondou
|
  |
| Joined: 05 Aug 2012 |
| Total Posts: 1148 |
|
|
| 18 Dec 2012 10:42 AM |
Script works now with GetRoleInGroup...
Now, the next issue I'm having with the script, is making it accept multiple groups, here is how I set it up.
function admin(player, role) role = role or "" if player:GetRoleInGroup(723652) == role then A=script.Parent.ClanAdmin A.Visible = true elseif player:GetRoleInGroup(630139) == role then A.Visible = true end end
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function()
admin(player, "Commander") admin(player, "General") admin(player, "Trainer") admin(player, "[HR] High General")
end) end)
Problem is, I'm back to it not working at all with no Output errors when I try to add a second group.
|
|
|
| Report Abuse |
|
|
Kondou
|
  |
| Joined: 05 Aug 2012 |
| Total Posts: 1148 |
|
|
| 18 Dec 2012 10:46 AM |
| Wait... Idk why I thought it worked to begin with, sorry it still doesn't work with just ONE group. |
|
|
| Report Abuse |
|
|
Kondou
|
  |
| Joined: 05 Aug 2012 |
| Total Posts: 1148 |
|
|
| 18 Dec 2012 11:11 AM |
Thanks for the help guys, I realized I was making it too complicated.
Working script
local player = script.Parent.Parent.Parent.Parent
if player:GetRankInGroup(723652) == 255 then script.Parent.ClanAdmin.Visible = true else script.Parent.ClanAdmin.Visible = false end
derp how easy lol... |
|
|
| Report Abuse |
|
|
Kondou
|
  |
| Joined: 05 Aug 2012 |
| Total Posts: 1148 |
|
|
| 18 Dec 2012 11:19 AM |
Now the issue is, when I tried to change
if player:GetRankInGroup(723652) == 255 then
to
if player:GetRankInGroup(723652) >= 7 then
the script stopped working with no error.
Help? |
|
|
| Report Abuse |
|
|