Click = Open for client

I had a problem with that for a long time. I just wanted to make a script that opens the door only for the client when the button is pressed but It doesn’t works in local script. I recently found something about Remote Functions and I thought it would help but it didn’t work idk why maybe i did something wrong.

I wanted to make script like 2 buttons pressed = door open

script.Parent.MouseClick:Connect(function()
    if script.Parent.Parent.Parent.Button1.Color == Color3.fromRGB(0, 255, 0) then -- 1st Parent = Click Detector, 2nd Parent = Button2 and 3th Parent = ButtonsFolder
        script.Parent.Color = Color3.fromRGB(0, 255, 0)
        workspace.BDoor.Transparency = 1
        workspace.BDoor.CanCollide = false
    else
        script.Parent.Color = Color3.fromRGB(0, 255, 0)
    end
end) -- and the same script in 1st button but Button2 instead of Button1 on the 2nd line

If i did something wrong or I broke a rule I’m sorry it’s my first time

If you want to work locally for clients, put it in a localscript in a place where localscripts run, such as StarterPlayerScripts.

If you have multiple of these, just put them in a folder, and loop through the folder’s children and connect the MouseClick event so it doesn’t take a long time to write them all

1 Like