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

How do I make this work? Filtering Enabled User door.

Asked by 6 years ago

My game is filtering enabled.For some reason which I dont know why this script wont work..

My layout is this https://i.imgur.com/6TL4T8X.png

Why wont this work? Im still learning how to script

local Open = false

function OpenDoor(player)
    if game.Players:FindFirstChild(player.UserId) == 86745980 then
    script.Parent.Frame.Transparency = 1
    script.Parent.Frame.CanCollide = false
    script.Parent.Screen.Transparency = 1
    script.Parent.Screen.CanCollide = false
    script.Parent.Screen.Texture.Transparency = 1
    script.Parent.Screen.Texture2.Transparency = 1
    script.Parent.Knob.Transparency = 1
    script.Parent.Knob.CanCollide = false
    script.Parent.Frame2.Transparency = 0
    script.Parent.Frame2.CanCollide = true
    script.Parent.Screen2.Transparency = 0
    script.Parent.Screen2.CanCollide = true
    script.Parent.Screen2.Texture.Transparency = 0
    script.Parent.Screen2.Texture2.Transparency = 0
    script.Parent.Knob2.Transparency = 0
    script.Parent.Knob2.CanCollide = true
    script.Parent.OpenFX:Play()
    Open = true
end

function CloseDoor()
    script.Parent.Frame.Transparency = 0
    script.Parent.Frame.CanCollide = true
    script.Parent.Screen.Transparency = 0
    script.Parent.Screen.CanCollide = true
    script.Parent.Screen.Texture.Transparency = 0
    script.Parent.Screen.Texture2.Transparency = 0
    script.Parent.Knob.Transparency = 0
    script.Parent.Knob.CanCollide = true
    script.Parent.Frame2.Transparency = 1
    script.Parent.Frame2.CanCollide = false
    script.Parent.Screen2.Transparency = 1
    script.Parent.Screen2.CanCollide = false
    script.Parent.Screen2.Texture.Transparency = 1
    script.Parent.Screen2.Texture2.Transparency = 1
    script.Parent.Knob2.Transparency = 1
    script.Parent.Knob2.CanCollide = false
    script.Parent.CloseFX:Play()
    Open = false
end

function ClickOpen()
    if Open == false then
        if script.Parent.Broken.Value == false then
            OpenDoor()
        end
    end
end

function ClickClose()
    if Open == true then
        if script.Parent.Broken.Value == false then
            CloseDoor()
        end
    end
end

function Knock()
    if Open == false then
        script.Parent.KnockFX:Play()
    end
end

script.Parent.Knob.ClickDetector.MouseClick:connect(ClickOpen)

script.Parent.Knob2.ClickDetector.MouseClick:connect(ClickClose)

script.Parent.Frame.ClickDetector.MouseClick:connect(Knock)
0
Perhaps it has to do with the fourth line, the player Id one. Try testing your script without that conditional. Le_Teapots 913 — 6y
0
yup it worked, Im still trying but for some reason it still wont work, think there is any way to make it work? Sergiomontani10 236 — 6y

Answer this question