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

Why doesn't my door script work?

Asked by 9 years ago

I wrote a Tycoon Door script by myself, but I can't get the door to work the way I want. Could someone help?

Script

Door.Touched:connect(function(Part)
    local Human = Part.Parent:FindFirstChild("Humanoid")
    if Human then
        local Player = game.Players:GetPlayerFromCharacter(Human.Parent)
        if Player then
            local isOwner = Player:FindFirstChild("isOwner")
            if isOwner then
                if isOwner.Value == false then
                    if TycoonOwner.Value == "" then
                        if Ready.Value then
                            TycoonOwner.Value = Player.Name
                            isOwner.Value = true
                            wait()
                            Door.Transparency = 0.25
                            Door.CanCollide = false
                        end
                    end
                end
            end
        end
    end
end)

Answer this question