How do I make an image button remove a certain tool from a players backpack?

Hello, I am currently working on an inventory for my game but I don’t know how to make a button that when pressed removes a certain tool from the player’s backpack. I could really use some help.

You need to use a remote event to get the player and make the removal on the server too,
It’s kind of simple but I’ll make a example real quick.

1 Like

can you explain a little more?

Basically if you remove the tool on the client I don’t think the server see’s it too. So if the server tries to delete it via MouseButtion1Click you can’t get the player, so you need a LocalScript to give you the player I guess. There are better ways to do this.
Sorry I took long, but this should work.

local Event = game.ReplicatedStorage.RemoveToolFromPlayer


TextButton or where ever it can detect MouseButton1Click

	local ToolName = "Codes"
	local player = game.Players.LocalPlayer
	local Tool = player.Backpack:FindFirstChild(ToolName)
1 Like