#Weird things with gui happening

1 messages · Page 1 of 1 (latest)

frail cipher
#

I have a few scripts that run when the game starts and they're supposed to make gui visible and invisible after 15 seconds, but after the time passes the gui starts flickering, pls help

#

script on server side: ```repeat task.wait()
game:IsLoaded()
until
game.ReplicatedStorage.SetupEvent:FireAllClients()
local function GenerateRooms(GemRoomAmount)
local roomsFolder = game.ServerStorage.Rooms

local rooms = roomsFolder:GetChildren()
local specialrooms = game.ServerStorage.SpecialRooms

for i, v in workspace.ReplaceRooms:GetChildren() do
    if game.CollectionService:HasTag(v, "Used") then continue end
    v:AddTag("Used")
    local random = rooms[math.random(1, #rooms)]
    local room = random:WaitForChild("Room")
    repeat task.wait() until room
    local newroom:Model = random:Clone()
    newroom.Parent = workspace.ReplaceRooms
    newroom:PivotTo(v.CFrame)
    v:Destroy()
end
--Boss Room Generation
local random = rooms[math.random(1, #rooms)]
local newbossroom = specialrooms.BossRoom:Clone()
newbossroom.Parent = workspace.SpecialRoomsWorkspace
newbossroom:PivotTo(random:WaitForChild("Room").CFrame)
random:Destroy()
--Gem Room Generation
for i = 1, GemRoomAmount do
    local random1 = rooms[math.random(1, #rooms)]
    local newgemroom = specialrooms.GemRoom:Clone()
    newgemroom.Parent = workspace.SpecialRoomsWorkspace
    newgemroom:PivotTo(random1:WaitForChild("Room").CFrame)
    random1:Destroy()
end

end

GenerateRooms(3)

task.wait(15)

workspace.Spawn.SpawnLocation.CanCollide = false