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)
The button thats supposed to give the gun but isnt
It’s path: