I'm making a carlift for my friend and I tried making it so that when you click a button it would make a wall collidable and visible. But for some reason it isnt working. Here's the script(s): (This LocalScript is in StarterGui to make sure it doesn't conflict with anything)
local Wall = game.Workspace.Wall1
Wall.ClickDetector.MouseClick:Connect(function()
game.Workspace.Wall1Event:FireServer()
end)
(This script is in Workspace)
local Wall = game.Workspace.Wall1
script.Parent.OnServerEvent:Connect(function()
if Wall.CanCollide == false then
Wall.CanCollide = true
else
Wall.CanCollide = false
end
if Wall.Transparency == 1 then
Wall.Transparency = 0.45
else
Wall.Transparency = 1
end
end)
Here is my explorer: https://imgur.com/a/w5zgTT3

1 comment
Try putting the remote event in ReplicatedStorage and the server script (second script) in ServerScriptService. Change stuff to fit in like "script.Parent" to "game.ReplicatedStorage.Wall1Event".