Dear ScriptingHelpers Community,
My script kind of works but I am not able to toggle my imablelabel visible state. Here is my code:
local popup = {}
local windowGui = nil
local windowImage = nil
function popup.create()
windowGui = Instance.new("ScreenGui")
windowGui.Parent = script.Parent
windowImage = Instance.new("ImageLabel")
windowImage.Parent = windowGui
windowImage.Position = UDim2.new(0, 25, 0, 50)
windowImage.Size = UDim2.new(0, 100, 0, 100)
windowImage.Image = "rbxassetid://133293265"
end
function popup.toggle(state)
windowImage.Visible = state
end
return popup
I can see my Image but if my script calls toggle it doesn't change the visible state. What is wrong?
Cheers, SmartLexx

4 comments
Well, I call create() first and thats why I see an Image. After that I call toggle() and it do nothing. Not visible false and true ... it doesn‘t switch.
Well yeah. I'll edit my post with a working code.
Why do I need to use require()? Anyway I will test this code today. Thank you
Because that's how ModuleScripts are used. They are meant to serve as a table for Scripts and LocalScripts and can't run on their own.