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

Why do the bricks only get removed for me?

I made a tool, that allows you to delete whatever you click on. I worked perfectly when I played solo in Studio, but when I played with other players in a server. I noticed that the bricks were only removed for the person that had the tool and clicked.

The script is in a localScript inside the tool:

tool = script.Parent
localPlayer = game.Players.LocalPlayer



tool.Equipped:connect(function(eventMouse)
	
eventMouse.Button1Down:connect(function()
	

	eventMouse.Target:remove()

	
	
	end)
end)

Thank you so much!

2 comments

0

If your game is FE then I recommend this for you: https://wiki.roblox.com/index.php?title=API:Class/RemoteFunction also use :Connect and :Destroy bcs :connect and :remove are deprecated

0

try Destroy() not remove()

2 answers

This is because the game is most likely FE.

You need to use a Remote Event (Client to Server) to fix this. Make the RemoteEvent on the server and then call it via the Client.

If you want it to be FE then you will have to rework the script as for most things that aren't. This mostly includes things such as GUIs and other things. Also you used button1 which is most commonly used for FE. If you would like to use it like that go to your workspace and disable FE If not find some other way to detect a click

1 comment

0

Also mousebutton1 Is commonly used for GUIs

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