Why is my ModuleScript function timing out?
Repost cause the previous question got no anwers.
01 | function Window.render(Buffer) |
05 | for i = 1 ,Window.Width + Window.Height do |
06 | local Pixel = Instance.new( "Frame" ) |
07 | Pixel.Size = UDim 2. new( 0 , 1 , 0 , 1 ) |
08 | Pixel.BorderSizePixel = 0 |
09 | Pixel.Position = UDim 2. new( 0 , i-(i*math.floor(i/Window.Width)), 0 , math.floor(i/Window.Width)) |
10 | Pixel.BackgroundColor 3 = Color 3. new( 0 , 0 , 0 ) |
11 | Pixel.Parent = Window.getInstance() |
15 | local Pixel = Instance.new( "Frame" ) |
16 | Pixel.Size = UDim 2. new( 0 , 1 , 0 , 1 ) |
17 | Pixel.BorderSizePixel = 0 |
18 | Pixel.Position = UDim 2. new( 0 , Buffer [ i ] [ "Index" ] .X, 0 , Buffer [ i ] [ "Index" ] .Y) |
19 | Pixel.BackgroundColor 3 = Buffer [ i ] [ "Color" ] |
20 | Pixel.Parent = Window.getInstance() |
25 | function Window.isCloseRequested() |
29 | function Window.getWidth() |
30 | Window.Width = game.Players.LocalPlayer.PlayerGui.Render.Frame.AbsoluteSize.X |
33 | function Window.getHeight() |
34 | Window.Height = game.Players.LocalPlayer.PlayerGui.Render.Frame.AbsoluteSize.Y |
37 | function Window.getInstance() |
38 | Window.Instance = game.Players.LocalPlayer.PlayerGui.Render.Frame |
Excerpt of the whole script
The script times out on line 4, not line 3 though despite the fact they are basically the same thing. This is being called from a LocalScript.
Also I'm 90% sure I'm returning stuff wrong since ive never really used ModuleScripts before. If it is wrong please let me know.