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: Level only door

Previous Thread :: Next Thread 
OriginalNexus is not online. OriginalNexus
Joined: 27 Oct 2008
Total Posts: 242
25 Sep 2014 05:52 PM
How do I make a script that only allows people who are above a certain level to pass through? And if not it kills them.
Report Abuse
kingping259 is not online. kingping259
Joined: 09 Mar 2009
Total Posts: 275
25 Sep 2014 05:56 PM
Put this in a script in the door.

level_required = 5

function OnTouched(part)
local char = part.Parent
local humanoid = char:findFirstChild("Humanoid")
local plyr = game.Players:findFirstChild(char.Name)
if char and humanoid and plyr then
lstats = plyr:findFirstChild("leaderstats")
if lstats then
level = lstats:findFirstChild("Level")
if level then
if level.Value >= level_required then
script.Parent.CanCollide = false
script.Parent.Transparency = 0.7
wait(2)
script.Parent.CanCollide = true
script.Parent.Transparency = 0
else
humanoid.Health = 0
end
end
end
end
end

script.Parent.Touched:connect(OnTouched)


> gg no re <
Report Abuse
OriginalNexus is not online. OriginalNexus
Joined: 27 Oct 2008
Total Posts: 242
26 Sep 2014 10:14 AM
Thanks man!
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