this is in a local script inside my part called "Story1"
local clickDetector = game.Workspace.Story1.ClickDetector clickDetector.MouseClick:Connect(function() script.Parent.SurfaceGui.TextLabel.TextTransparency = 1 script.Parent.SurfaceGui.TextLabel.BackgroundTransparency = 1 script.Parent.CanCollide = false script.Parent.Transparency = 1 end)
Hello. It's probably not working because you put the LocalScript in the wrong spot. Put it in StarterPlayer > StarterPlayerScripts
. Also, use the destroy function as "SilentsReplacement" said. I hope this helps.
Don't worry, it will only remove it for the client. Assuming that your part is in the workspace, the script would be as follows:
local clickDetector = game.Workspace.Story1.ClickDetector clickDetector.MouseClick:Connect(function() game.Workspace.Block:Destroy() -- Correct this to your block's position script.Parent.SurfaceGui.TextLabel.TextTransparency = 1 script.Parent.SurfaceGui.TextLabel.BackgroundTransparency = 1 script.Parent.CanCollide = false script.Parent.Transparency = 1 end)