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
 

Re: GetRoleInGroup function

Previous Thread :: Next Thread 
BloxDaily is not online. BloxDaily
Joined: 08 Feb 2013
Total Posts: 5319
30 Nov 2013 10:07 PM
I need help to where there in this group but a certain rank to go through.

debounce = false

script.Parent.Touched:connect(function(hit)
if (hit) then
if (hit.Parent) then
if (game.Players:GetPlayerFromCharacter(hit.Parent)) then
if (game.Players:GetPlayerFromCharacter(hit.Parent):IsInGroup(991999)) then
debounce = true
script.Parent.Transparency = 0.5
script.Parent.CanCollide = false
wait(2)
script.Parent.Transparency = 0
script.Parent.CanCollide = true
debounce = false
end
end
end
end
end)



Ranks are 4 and above which max/highest is 13 to be able for it to make the door's transparency to 0.5 and cancollide = false
Report Abuse
BloxDaily is not online. BloxDaily
Joined: 08 Feb 2013
Total Posts: 5319
30 Nov 2013 10:11 PM
.
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
30 Nov 2013 10:15 PM
debounce = false

script.Parent.Touched:connect(function(hit)
local Player = Game.Players:GetPlayerFromCharacter(hit.Parent)
if not Player then return end
if Player:GetRoleInGroup(991999) >= 4 then
debounce = true
script.Parent.Transparency = 0.5
script.Parent.CanCollide = false
wait(2)
script.Parent.Transparency = 0
script.Parent.CanCollide = true
debounce = false
end
end)
Report Abuse
BloxDaily is not online. BloxDaily
Joined: 08 Feb 2013
Total Posts: 5319
30 Nov 2013 10:57 PM
@cody

23:56:01.378 - Workspace.Door.Script:6: attempt to compare number with string
23:56:01.379 - Script 'Workspace.Door.Script', Line 6
23:56:01.380 - stack end
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
30 Nov 2013 10:58 PM
GetRankInGroup
Report Abuse
jakej78b is not online. jakej78b
Joined: 09 Mar 2011
Total Posts: 813
30 Nov 2013 11:19 PM
debounce = false
role = "Rank Name" -- Either role or rank, or both.
rank = 255 -- 255 = owner only

script.Parent.Touched:connect(function(hit)
if not debounce then
player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and hit.Parent then

if player:GetRoleInGroup(991999) == role or player:GetRankInGroup(991999) == rank then
debounce = true
script.Parent.Transparency = 0.5
script.Parent.CanCollide = false
wait(2)
script.Parent.Transparency = 0
script.Parent.CanCollide = true
debounce = false
end end end end)
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