Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why does this not even print "1"?

The script is not disabled and no errors appear, very odd. code:

local fram = script.Parent.back
local num = 1

game.Players.PlayerAdded:connect(function(plr)
	print("1")
    for _,v in pairs(plr:WaitForChild("Inventory"):GetChildren()) do
	print("2")
        local item = Instance.new("ImageButton", fram)
        item.BackgroundTransparency = 1
        item.Name = "item"..tostring(num)
        item.Size = UDim2.new(.02, 0, .6, 0)
		local ex = item.Name:sub(4)
        item.Position = UDim2.new(tonumber(ex / 50), 0, 0.15, 0)
        item.Image = "rbxassetid://"..tostring(v.itemPrev.Value)
        item.ZIndex = 2
		num = num + 1
    end
end)

4 comments

0

try using local fram = script.Parent:WaitForChild("back")

0

Is this a local script?

0

not a local script, and that didnt work bubba

0

actually a local script will work with this code the real program is that a it is possible that the code breaks at line 1. I highly suggest commenting the first list and you will see it will print 1 when a user is added.

1 answer

✓ Accepted answer

The only possible problems I can think of are that the script is not in the server(workspace), or you could have put the script in a localscript. You code would only work in a regular script.

This discussion is preserved as it was. New answers, comments, and votes are closed.