Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why is this script not working?

I need this to be a game pass/owner only door but it wont even work as an owner only door and I don't want it to kill other people

function g(p)
local hum = p.Parent:findFirstChild("Humanoid")
if (hum ~= nil) then
if game.Players:findFirstChild(hum.Parent.Name).Name == "danielsarabia11" then
script.Parent.CanCollide = false
script.Parent.Transparency = 0.5
wait(0.5)
script.Parent.CanCollide = true
script.Parent.Transparency = 0
else
hum:TakeDamage(100) -- IF YOU PLAYER TO DIE IF IT IS NOT YOU, IF YOU DONT WANT IT THEN DELETE THIS LINE AND THE "else"
end
end
end

script.Parent.Touched:connect(g)

-credit to Hybric for script

1 answer

✓ Accepted answer

I just gave you that script, Wow really no credit.. Like i said in the other answer, THE SCRIPT MUST BE IN A PART


function g(p)
local hum = p.Parent:findFirstChild("Humanoid")
if (hum ~= nil) then
if game.Players:findFirstChild(hum.Parent.Name).Name == "danielsarabia11" --[[CHANGE DANIELSARABIA11 TO YOUR ROBLOX USERNAME]] then
script.Parent.CanCollide = false
script.Parent.Transparency = 0.5
wait(0.5)
script.Parent.CanCollide = true
script.Parent.Transparency = 0

end
end
end

script.Parent.Touched:connect(g)
print("THIS SCRIPT MUS BE INSIDE ANY PART, I TESTED IT IN STUDIO IT WORKS")

This discussion is preserved as it was. New answers, comments, and votes are closed.