For some unknown reason, my local script is not running properly where print statements are not printing after cloning an imagelabel.
I’ve tried to prevent it by commenting out any code referencing the clone, yet even then none of those print statements run.
local frame = workspace:WaitForChild("P2Screen").SurfaceGui.Frame
local layout = frame.UIListLayout
local card = game.ReplicatedStorage.Card
local cardsize = 109.89
local numcards = 1
local function spacingformula(cards)
print("function") -- has not printed at all either
local number = (frame.AbsoluteSize.X - (cards*cardsize))/cards
if number < 0 then
return number
else
return 0
end
end
print(spacingformula(5)) -- printed nothing when ran
while task.wait(5) do
print("woo")
numcards += 1
print("what")
local newcard = card:Clone() -- no print statements past this point print anything
print("cloned")
newcard.Parent = frame
local spacing = spacingformula(numcards)
print("fdone")
layout.Padding = UDim.new(0,spacing)
print("done")
end
The only things that are printed into the console is “woo” and “what”.
Is there anything wrong with my script or is this more of an engine problem?
It appears that the code after local newcard = card:Clone() runs due to looking at the value of padding in the UiListLayout but the print statements do not output anything. It’s strange.
there are two card imagelabels so it is cloning which means it does get past the cloning code, skipping any print statements after it or something though