Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Frame Not Cloning. I constantly get the same frame?

Asked by 4 years ago

I have this code:

local player = game.Players.LocalPlayer
local ItemGui = script.Parent.Item
local ObjectName = script.Parent.Item.ItemName

player.Inventory.ChildAdded:Connect(function(child)
    ItemGui:Clone()
    ItemGui.Parent = script.Parent
    ObjectName.Text = child.Name
end)

but it won't clone the frame. Can someone help me?

1 answer

Log in to vote
0
Answered by
jgftr7 74
4 years ago

Try this:

local player = game.Players.LocalPlayer
local ItemGui = script.Parent.Item
local ObjectName = script.Parent.Item.ItemName

player.Inventory.ChildAdded:Connect(function(child)
    local clonegui = ItemGui:Clone()
    clonegui.Parent = script.Parent
    ObjectName.Text = child.Name
end)

also it doesn't work because you're supposed to make it a var.

0
Hope i helped jgftr7 74 — 4y
0
yes it did. Thanks!! FireDreamGames 17 — 4y
Ad

Answer this question