generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Group GUI Script

Previous Thread :: Next Thread 
Kondou is not online. 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
vampirexevipex is not online. vampirexevipex
Joined: 11 Apr 2009
Total Posts: 1598
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 is not online. Kondou
Joined: 05 Aug 2012
Total Posts: 1148
18 Dec 2012 07:20 AM
Nothing comes up on output.
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
18 Dec 2012 07:38 AM
No need for the 'or "" '
Report Abuse
Kondou is not online. 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 is not online. 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
littleAU999 is not online. littleAU999
Joined: 15 Jan 2011
Total Posts: 1375
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 is not online. 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 is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
18 Dec 2012 10:36 AM
GetRoleInGroup needs to be GetRoleIsInGroup
Report Abuse
Kondou is not online. 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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image