I want to make a shop with a equip/unequip system on it, i just can make a shop but not a equip/unequip system
Events:
game.ReplicatedStorage.Buy.OnServerEvent:Connect(function(player, item)
for _, i in pairs(player.Backpack:GetChildren()) do
if i.Name == 'Item'..item then return end
end
for _, i in pairs(player.Character:GetChildren()) do
if i.Name == 'Item'..item then return end
end
local clone = game.ReplicatedStorage.Items["Item"..item]:Clone()
clone.Parent = player.Backpack
end)
Item:
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Parent.ItemInfo.Item.Value = 1
end)
Buy Script:
script.Parent.MouseButton1Click:Connect(function()
local item = script.Parent.Parent.Item.Value
game.ReplicatedStorage.Buy:FireServer(item)
end)
Who can help please!