My Inventory system which allows users to pick up items off the ground (items use a clickdetector system) but if I made the items script that allows them to pick up the item localscript or regular script it still doesn't work online its confusing and annoying me because I need a decent public release for my game
Item script
local Obj = script.Parent
Obj.ClickDetector.MouseClick:connect(function(plr)
Obj:FindFirstChild('PlrName').Value = plr.Name
local PlrGUI = game.Players:FindFirstChild(plr.Name).PlayerGui
if PlrGUI then
local MaxSlots = {1,2,3,4,5,6}
for _, v in pairs(MaxSlots) do
local vx = PlrGUI.Inventory.Frame:FindFirstChild("Slot" .. tostring(v))
if vx and vx.Item.Value == "" then
vx.Item.Value = Obj.Name
Obj:Destroy()
break
end
end
end
end)
The script that changes the Inventory slot to the item name
script.Parent.MouseButton1Down:connect(function(clicked)
if script.Parent.Parent.Parent.Slot1Item.Visible == true then
script.Parent.Parent.Parent.Slot1Item.Visible = false
else
script.Parent.Parent.Parent.Slot1Item.Visible = true
end
end)
