Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

Allow admins to bypass script?

Asked by 8 years ago

I have a script that will kick anyone who's health goes above 120. Now I want it so I can make certain people not crash when they health themselves over 120 or god themselves. This is the script:

--Variables MaxHealth = 120 --Allowed MaxHealth. If higher then player crashes.

Health,_ = 0,120 --Health range. If higher or lower then player crashes.

game.Workspace.ChildAdded:connect(function(Child) -- local Humanoid = Child:findFirstChild("Humanoid") local Player = game.Players:findFirstChild(Child.Name) if Humanoid then if Player then Humanoid.Changed:connect(function() if Humanoid.Health >= Health and Humanoid.Health <= _ then else Player:Remove() end if Player and Humanoid.MaxHealth > MaxHealth then Player:Remove() end end) end end end) --

0
Please CodeBlock your Code. UniversalDreams 205 — 8y
0
What he said. ^^^ AZDev 590 — 8y
0
Not going to post this as an answer since it really isn't. I would probably just make this part of your admin script, then use an if statement to check if the player is not an admin. AZDev 590 — 8y

Answer this question