To achieve this effect with a server script, you must use RemoteEvents and two scripts
the script in the click block (server) should look like this:
3 | game.ReplicatedStorage.collision:FireClient(plr, workspace.Wall 1 ) |
7 | script.Parent.ClickDetector.MouseClick:connect(onClicked) |
A remote event should be placed in replicated storage ( i name it "collision" )
and the local script should be placed in startercharacterscripts, with the following code.
1 | game.ReplicatedStorage.collision.OnClientEvent:Connect( function (part) |
2 | part.CanCollide = false |
the local script can be sent for by any server script, to change the collision of any brick.
Hope this was helpful :)