|
| 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 |
|
|
|
| 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 |
|
|
| |
|