Im creating a school bell gui and i need to be able to go through all the the classes listed in a table in a module script.
the current code i have 1. doesn’t work, and 2. i probably used it wrong.
local textLabel = script.Parent
function typeWrite(object,text)
for i = 1,text,1 do
object.Text = string.sub(1,i)
wait(0.05)
end
end
game.ReplicatedStorage.School.OnServerEvent:Connect(function(player, mode)
local classes = require(game.ServerScriptService.ConfigureClasses)
if player:GetRankInGroup(9822548) >= 251 then
if mode == "ADay" then
local classesToday = classes.ClassesInADay
local timeForThisClass = classes.TimeForADayClasses
elseif mode == "BDay" then
local classesToday = classes.ClassesInBDay
local timeForThisClass = classes.TimeForBDayClasses
elseif mode == "EarlyDissmissal" then
local classesToday = classes.ClassesInEarlyDissmissalDay
local timeForThisClass = classes.TimeForEarlyDissmissalClasses
for i = 1,classesToday,1 do
typeWrite(textLabel, "Current Class: "..i)
end
end
end
end)
Yes, but you can add a lot of classes and I would need to loop through the classes to get them 1 by 1 after 60 seconds or 30 seconds. so if i used table.find then I would have to have a way to detect how many items are in the table.