Post Comment ways plz
this is for a gui button btw
local ded = find:Destroy() ded.Parent = player.Backpack
does not work for the script im trying to use this error keeps poppin up
18:25:14.303 - Players.Player.PlayerGui.Shop/System.InventoryTab.Inventory.Item.EquipOrUnequip.LocalScript:10: attempt to index local 'cl' (a nil value)
--LocalScript in StarterPack or StarterGui local player = game:GetService("Players").LocalPlayer player.Backpack.ITEMNAMEHERE:remove()
You could also restrict permission too!
--LocalScript in StarterPack or StarterGui local player = game:GetService("Players").LocalPlayer if player.Name == "USERNAMEHERE" then else player.Backpack.ITEMNAMEHERE:remove() end
local toolholders = {"Player", "USERNAMEHERE"} for i, v in pairs(toolholders) do if v == player.Name then end else player.Backpack.ITEMNAMEHERE:remove() end
Hope this helped!
To remove certain tools from playeys, you could use a local script
player = game.Players.LocalPlayer player.Backpack:FindFirstChild("NAME HERE"):Destroy()
you can fire this script with a event as your please. You could also use a script that removes it when a part is touched. For example, here is a script that is inside of the part
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local player = game.Players:GetPlayerFromCharacter(hit.Parent) local pack = player.Backpack pack:FindFirstChild("NAME HERE"):Destroy()
you can also do it by click detector 2. Click detector uses a paramter of the player who clicked it so therefor you would do the following
script.Parent.ClickDetector.MouseClick:connect(function(player) local pack = player.Backpack pack:FindFirstChild("NAME HERE"):Destroy() end)
Of course there are several other ways to do it, but these two are the most common