I just restarted the whole thing with up to date methods and made it pretty, and I tested, this should work for you!
local Door, db = script.Parent, false
Door.Touched:Connect(function(hit)
if hit.Name == "HumanoidRootPart" and game:GetService("Players"):GetPlayerFromCharacter(hit.Parent) then
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if player:FindFirstChild("leaderstats") and player.leaderstats:FindFirstChild("Prestige") then
if player.leaderstats.Prestige.Value >= 100 then
db = true
print("Human passed test")
Door.Transparency = .5
Door.CanCollide = false
wait(3)
Door.CanCollide = true
Door.Transparency = 0
db = false
end
end
end
end)
|