Hello guys, I'm hoping that you can help me here. I've been trying to figure out what is wrong with this script but I cannot find anything. It is supposed to check if my Rank does not have enough permissions to open the door it's supposed to kill the player but instead it kills me no matter what my Rank is. Please see code below if I didn't make sense here. Any help appreciated.
Scanning = false
function Scan(hit)
if Scanning == false then
Scanning = true
if hit.Parent:FindFirstChild("Humanoid") then
local Player = game.Players[hit.Parent.Name]
if Player:WaitForChild('leaderstats').Rank.Value == 'Hotel Guest' or 'Suspended' or 'Noted Guest' or 'Trainee' or 'Receptionist' or 'Senior Receptionist' then
print("\\ACCESS RESTRICTED\\ ~~ "..Player.Name)
local Gui = game.ServerStorage.AccessDenied:Clone()
Gui.Parent = Player.PlayerGui
Player.Character.Humanoid.WalkSpeed = 0
wait(1)
Player.Character.Humanoid.Health = 0
wait(2)
Scanning = false
else
Scanning = false
end
else
Scanning = false
end
else
end
end
script.Parent.Touched:connect(Scan)

2 comments
Thank you Azarth for trying to help me. Your answer did not work and nothing is showing up in the output. I appreciate your willingness to help anyway.
I edited your code a bit and it worked. Thank you.