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

Guys can't set the value of frame visibility to true?

Asked by 6 years ago
Edited 6 years ago
script.Parent.Touched:connect(function(p)
    if p.Parent.Name == "MainKey" then
        local door = script.Parent.Parent.Door1
        local handle = script.Parent
        local door2 = script.Parent.Parent.Door2
        local handle2 = script.Parent.Parent.Handle2
        door.Transparency = 1
        door.CanCollide = false
        handle.Transparency = 1
        door2.Transparency = 0
        door2.CanCollide = true
        handle2.Transparency = 0
        wait(1)
        door.Transparency = 0
        door.CanCollide = true
        handle.Transparency = 0
        door2.Transparency = 1
        door2.CanCollide = false
        handle2.Transparency = 1
        else
            game.StarterGui.DoorGUI.Instructions.Visible = true
    end
end)

I've tried this

script.Parent.Touched:connect(function(p)
    if p.Parent.Name == "MainKey" then
        local door = script.Parent.Parent.Door1
        local handle = script.Parent
        local door2 = script.Parent.Parent.Door2
        local handle2 = script.Parent.Parent.Handle2
        door.Transparency = 1
        door.CanCollide = false
        handle.Transparency = 1
        door2.Transparency = 0
        door2.CanCollide = true
        handle2.Transparency = 0
        wait(1)
        door.Transparency = 0
        door.CanCollide = true
        handle.Transparency = 0
        door2.Transparency = 1
        door2.CanCollide = false
        handle2.Transparency = 1
        elseif p.Parent.Name ~= "MainKey" then
            game.StarterGui.DoorGUI.Instructions.Visible = true
    end
end)

I've also tried this

local Instructionsss = game.StarterGui.DoorGUI.Instructions
script.Parent.Touched:connect(function(p)
    if p.Parent.Name == "MainKey" then
        local door = script.Parent.Parent.Door1
        local handle = script.Parent
        local door2 = script.Parent.Parent.Door2
        local handle2 = script.Parent.Parent.Handle2
        door.Transparency = 1
        door.CanCollide = false
        handle.Transparency = 1
        door2.Transparency = 0
        door2.CanCollide = true
        handle2.Transparency = 0
        wait(1)
        door.Transparency = 0
        door.CanCollide = true
        handle.Transparency = 0
        door2.Transparency = 1
        door2.CanCollide = false
        handle2.Transparency = 1
        else
            instructionsss.Visible = true
    end
end)

I've also tried adding a repeat and until!

1 answer

Log in to vote
0
Answered by 6 years ago

Guys any one that can answer this??

By the way the script is inside the part in workspace

Ad

Answer this question