In summary, the function called ‘generate’ creates a UI, the parameter called ‘p’ is the parent of the UI, in this case it is equal to the GUI folder of player user.
The problem I’m currently experiencing is a for i, v in loop that doesn’t break, well it breaks but after 4 times it generated a UI.
How can it be made so that it only generates one UI?
Here’s the code:
Function:
function generate(v)
local table = {
["Screen"] = Instance.new("ScreenGui"),
["Image"] = Instance.new("ImageLabel"),
["Text"] = Instance.new("TextLabel")
}
--// Names and Parents
table.Screen.Name = "Supreme Jesus" table.Screen.Parent = p table.Image.Name = "Main" table.Image.Parent = table.Screen table.Text.Name = "WordsOfJesus" table.Text.Parent = table.Screen
--// Settings
table.Screen.IgnoreGuiInset = true table.Image.Image = "rbxassetid://13854443902" table.Image.Size = UDim2.new(1,0,1,0) table.Text.Size = UDim2.new(0,5,0,5) table.Text.Position = UDim2.new(0,800,0,50)
table.Text.TextColor = BrickColor.new("White") table.Text.TextSize = 30
--// Fun
table.Text.Text = "Hello, sorry for interrupting your day." task.wait(2) table.Text.Text = "But, i need to give a special annoucement."
Problem:
for i, v in ipairs(raw:GetPlayers()) do
local p = v.PlayerGui
generate(v.PlayerGui)
task.wait(.1)
break
end
Thank you