So I'm trying to make an inventory (something temporarily because I'm new to scripting), I'm trying to get the object to change its parent when the thing is true in my script :L Don't know if that made sense...
Here's the script
local Player = game.Players.LocalPlayer local mouse = Player:GetMouse() local Item = game.Workspace.Item local slot = Player.PlayerGui.Inventory.Frame local Slots = {} mouse.Button1Down:connect(function() if mouse.Target:FindFirstChild("Pick up") then if slot.Slots.S1 == true then slot.Slots.S1.Value = false Item.Parent = slot local M1 = Instance.new("ImageButton", slot) M1.name = "Stol 1" table.insert(Slots, 1, 1) print(Slots[1]) elseif slot.Slots.S2 == true then slot.Slots.S2.Value = false Item.Parent = slot local M1 = Instance.new("ImageButton", slot) M1.name = "Stol 2" table.insert(Slots, 2, 2) print(Slots[2]) elseif slot.Slots.S3 == true then slot.Slots.S3.Value = false Item.Parent = slot local M1 = Instance.new("ImageButton", slot) M1.name = "Stol 3" table.insert(Slots, 2, 2) print(Slots[3]) elseif slot.Slots.S3 == true then slot.Slots.S3.Value = false Item.Parent = slot local M1 = Instance.new("ImageButton", slot) M1.name = "Stol 3" table.insert(Slots, 2, 2) print(Slots[4]) end end end)