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: How To

Previous Thread :: Next Thread 
Coogylox is not online. Coogylox
Joined: 05 Jan 2010
Total Posts: 38
05 Apr 2014 01:50 AM
I have a helmet for this group I am in. It works, but I want to make certain helms only available to certain ranks. So far, I have this:

groupid="0000000"
b=script.Parent
r=true
b.Touched:connect(function(t)
p=game.Players:getPlayerFromCharacter(t.Parent)
if p then
if p:IsInGroup(groupid)then
if r then
r=false
for i=1,10 do
wait(.1)
b.Transparency=i/10
end
b.CanCollide=false
wait(2)
for i=1,10 do
wait(.1)
b.Transparency=1-(i/10)
end
r=true
end
else
h=p.Character:findFirstChild"Humanoid"
if h then
h.Health=0
end end end end)

However, that lacks anything to check rank. Does anyone know what to do to make it check for a certain rank or higher than that rank to allow one to use the helm?
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
05 Apr 2014 04:29 AM
groupid="0000000"
b=script.Parent
r=true
b.Touched:connect(function(t)
p=game.Players:getPlayerFromCharacter(t.Parent)
if p.Parent.Humanoid ~= nil then
if p:IsInGroup(groupid)then
if r then
r=false
for i=1,10 do
wait(.1)
b.Transparency=i/10
end
b.CanCollide=false
wait(2)
for i=1,10 do
wait(.1)
b.Transparency=1-(i/10)
end
r=true
end
else
h=p.Character:findFirstChild("Humanoid")
if h ~= nil then
h.Health=0
end end end end)
Report Abuse
Coogylox is not online. Coogylox
Joined: 05 Jan 2010
Total Posts: 38
05 Apr 2014 06:16 PM
That doesn't check for rank withing a group. I need a script that will say something like:

if p:IsInGroup(groupid) then
if p:RankInGroup(255) then

Something like that. It has to check for rank.
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
05 Apr 2014 06:18 PM
if p:GetRankInGroup(groupid) >= rankrequired then
Report Abuse
Coogylox is not online. Coogylox
Joined: 05 Jan 2010
Total Posts: 38
06 Apr 2014 01:59 PM
Thank you sir.
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
06 Apr 2014 11:24 PM
Remember the nil checks.
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
06 Apr 2014 11:26 PM
(The reason I say that is remembering values which is which because youre script's variables is really unorganized.)
Report Abuse
Coogylox is not online. Coogylox
Joined: 05 Jan 2010
Total Posts: 38
07 Apr 2014 06:28 PM
The p:GetRankInGroup deal didn't work. p3p
Report Abuse
Coogylox is not online. Coogylox
Joined: 05 Jan 2010
Total Posts: 38
07 Apr 2014 06:33 PM
Nevermind. Put it in the wrong place. Thank you for all the 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