so this is a button to lock or unlock doors and it is in a (script) inside of the button but it doesnt't work on filtering enabled how do I make it work on the filtering enabled so that people can still use the button

And this is a NORMAL Script not local

function onButtonClicked()
local x = game.Workspace:FindFirstChild("Home"..script.Parent.Parent.Parent.Parent.Name)
if not (x) then
return
else
if script.Parent.Text == "Lock House Doors" then
script.Parent.Text = "Unlock House Doors"
x.Home.FDoor.CanCollide = true
elseif script.Parent.Text == "Unlock House Doors" then
script.Parent.Text = "Lock House Doors"
x.Home.FDoor.CanCollide = false
end
end
end
script.Parent.MouseButton1Click:connect(onButtonClicked)

3 comments

0

This is a NORMAL script right? Let me know and then I can solve this.

0

yes

0

This is most likely not working because GUI buttons can’t be used with server scripts. Changing it to a localscript also won’t work as the script then can’t change the door’s collide property.