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

Why won't this work?

Asked by
Nidoxs 190
9 years ago
local user = "doctorbenny2011" -- change this to the name of the person the personal door belongs to


local door = script.Parent
local doorTransparency = door.Transparency 

function onTouched(hit)
    local character = hit.Parent

    if character:FindFirstChild("Humanoid") then
        if string.lower(hit.Parent.Name) == string.lower(user) then

            script.Parent.CanCollide = false
            script.Parent.Transparency = 0.4

            wait(2) -- The length of time you want the door to be open for

            script.Parent.CanCollide = true
            script.Parent.Transparency = 0
        else
             -- remove this line if you want a non-killing door
        end
    end
end

script.Parent.Touched:connect(onTouched)
0
Did you place your clearly free-modeled script as the door's child? Marios2 360 — 9y

Answer this question