Need help for an inventory not giving tools

Im trying to make an inventory for guns in a simulator im working on, so im making this inventory which checks the values that you own the gun (when you buy a gun from the shop it sets a value that you own it so it gives it to you) I made it check if you own the gun so you have it in the inventory and when you press the button to equip it nothing happens,and nothing shows in the output so its even harder for me to fix it because i dont know where or what the problem is.

This is the part that doesnt work.

local player = script.Parent.Parent.Parent.Parent.Parent

script.Parent.Gun1Inv.MouseButton1Click:Connect(function()
	if script.Parent.Gun1Inv.EQUIP.Text == "EQUIP" then
		game.ServerStorage.SavedTools["Luger P08"]:Clone().Parent = player.Backpack
		game.ServerStorage.SavedTools["Luger P08"]:Clone().Parent = player.StarterGear
		script.Parent.Gun1Inv.EQUIP.Text = "UNEQUIP"
	elseif script.Parent.Gun1Inv.EQUIP.Text == "UNEQUIP" then
		script.Parent.Gun1Inv.EQUIP.Text = "ALREADY EQUIPPED!"
		wait(1)
		script.Parent.Gun1Inv.EQUIP.Text = "EQUIP"
	end
end)

The path: (If it’s needed)
image_2021-12-06_211336

The button thats supposed to give the gun but isnt
image_2021-12-06_211913
It’s path:
image_2021-12-06_212002

1 Like
  1. A Script won’t run on the client, only local scripts do,
  2. To get the player on the client , use game.Players.LocalPlayer
  3. If you want to equip a Tool from UI, you need to have the client Fire a remote Event / Function for the server to equip the tool,
2 Likes