I have the following code:
local human = hit.Parent:findFirstChild("Humanoid")
I know that it searches for the humanoid, but I want to change it so that it finds the "Admins" stat in leaderstats. Do I have to change it from ("Humanoid") into ("Admins") or ("leaderstats")? Or do I change it to anything else?
Thank you for your help
The script as requested:
function onTouched(hit) print("Door Hit") local human = hit.Parent:findFirstChild("Humanoid") if (human ~= nil ) then if human.Parent.Torso.roblox.Texture == texture then Door.Transparency = 0.6 Door.CanCollide = false wait(3) Door.CanCollide = true Door.Transparency = 0 print("Human touched door") elseif (checkOkToLetIn(human.Parent.Name)) then print("Human passed test") Door.Transparency = 0.7 Door.CanCollide = false wait(3) Door.CanCollide = true Door.Transparency = 0 elseif (This is where my question comes in) >=1 then --This part is where I'm stuck on Door.Transparency = 0.7 Door.CanCollide = false wait(3) Door.CanCollide = true Door.Transparency = 0 end end end
The leaderstats aren't found inside the humanoid
they're found directly inside the player
.
If it were inside a LocalScript it would be like this:
local leaders = game.Players.LocalPlayer:FindFirstChild("leaderstats")