Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a click detector only remove the block for the client that clicked?

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)

2 answers

✓ Accepted answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.