I have tried to make an image button switch the "CanCollide" property on and off, but I seemed to have failed. I have looked close to everywhere I could and didn't find my answer. I am starting to get desperate and wanted to ask. Here is what I have done in my attempt. I also want it so the player can not affect the entire server, of course. ObbyParts is the folder that holds parts, GhostPart is the part I am trying to modify, and "Un Ghostified Button" is the off version of the image button.
local Button = game.StarterGui.ScreenGui.ImageButton local function leftClick() if Button.Image("rbxgameasset://Images/Un Ghostified Button") then game.Workspace.ObbyParts.GhostPart.CanCollide = true else game.Workspace.ObbyParts.GhostPart.CanCollide = false end end Button.MouseButton2Click:Connect("leftClick")