This is the object that I want the status bar to connect with correspond with the status bar.
This is the object I would like toHere is the script that I have for it.
local ADaySchedule={{
"Period 1 - [C1] Algebra 1 | [C2] Visual Art | [Honors] Study Hall",
"Period 2 - [C1] English | [C2] Physical Science | [Honors] Biology",
"Period 3 - [C1] World History | [C2] English | [Honors] English",
"Period 4 - [C1] Physical Science | [C2] Study Hall | [Honors] Informational Technology",
"Period 5 - [C1] Informational Technology | [C2] World History | [Honors] English",
"Lunch",
"Period 6 - [C1] Study Hall | [C2] Informational Technology | [Honors] Geography",
"Period 7 - [C1] Business Professionals | [C2] Algebra 1 | [Honors] World History",
"Period 8 - [C1] Physical Education | [C2] Geography | [Honors] Geometry"
},{10,20,20,20,20,16,20,20}}
local BDaySchedule={{
"Period 1 - [C1] Algebra 1 | [C2] Physical Education | [Honors] Study Hall",
"Period 2 - [C1] English | [C2] Physical Science | [Honors] Physical Education",
"Period 3 - [C1] World History | [C2] English | [Honors] English",
"Period 4 - [C1] Physical Science | [C2] Study Hall | [Honors] Informational Technology",
"Period 5 - [C1] Informational Technology | [C2] World History | [Honors] English",
"Lunch",
"Period 6 - [C1] Study Hall | [C2] Informational Technology | [Honors] Business Professionals",
"Period 7 - [C1] Geography | [C2] Algebra 1 | [Honors] World History",
"Period 8 - [C1] Visual Art | [C2] Business Professionals | [Honors] Geometry",
},{10,20,20,20,20,16,20,20}}
local DelaySchedule={{
"Advisory - [S1 | S2] - Advisory | ROOM 118A",
"Period 1 - [S1] - Math | ROOM 110A || [S2] English | ROOM 111A",
"Period 2 - [S1] - English | ROOM 111A || [S2] Math | ROOM 110A",
"Period 3 - [S1] - Science | ROOM 113A || [S2] Social Studies | ROOM 112A",
"Period 4 - [S1 | S2] - Lunch | ROOM 107A",
"Period 5 - [S1] - Social Studies | ROOM 112A || [S2] Science | ROOM 113A",
},{10,15,15,15,15,15}}
--Script--
local gui=script.Parent.SurfaceGui.Frame
local bell=gui.Bell
local server=gui.Server
local hint=script.Parent:WaitForChild("Hint")
--Refresh bell when server starts--
bell.Main.Visible=true
bell.Progress.Visible=false
bell.Setup.Setup.Visible=false
bell.Setup.Schedule.Visible=false
bell.Setup.Specif.Visible=false
bell.Setup.Visible=false
if script:findFirstChild("Bell")==nil then
ring = Instance.new("Sound")
ring.Name="Bell"
ring.SoundId="http://www.roblox.com/asset/?id=19344667"
ring.Volume=1
ring.Pitch=0.7
ring.Looped=true
ring.Parent=script
else
ring=script.Bell
end
--Refresh Finished. Assign Buttons..
--Main Section of Script--
local Schedule=nil
local Period=1
local endofday = false
local run=false
function ListSchedules()
bell.Setup.Schedule.List:ClearAllChildren()
local list={"SemesterOne","SemesterTwo","DelaySchedule"}
for a,v in pairs(list) do
local SizeY = 1/#list
local Pos = (a-1)/#list
local clk = Instance.new("TextButton")
local type=list[a]
clk.BackgroundTransparency = 1
clk.Style="RobloxButton"
clk.Name = "Data"
clk.TextScaled = true
clk.TextWrapped = true
clk.TextColor3 = Color3.new(1,1,1)
clk.Text = list[a]
clk.Size = UDim2.new(1,0,SizeY,0)
clk.Position = UDim2.new(0,0,Pos,0)
clk.Parent=bell.Setup.Schedule.List
clk.MouseButton1Down:connect(function()
Schedule=list[a]
local all=bell.Setup.Schedule.List:getChildren()
for a=1,#all do
all[a].Selected=false
end
clk.Selected=true
end)
end
end
function ListPeriods()
bell.Setup.Specif.List:ClearAllChildren()
local list=ADaySchedule
if Schedule=="ADaySchedule" then
list=ADaySchedule
elseif Schedule=="BDaySchedule" then
list=BDaySchedule
elseif Schedule=="DelaySchedule" then
list=DelaySchedule
end
for a,v in pairs(list[1]) do
local SizeY = 1/#list[1]
local Pos = (a-1)/#list[1]
local clk = Instance.new("TextButton")
local type=list[1][a]
clk.BackgroundTransparency = 1
clk.Style="RobloxButton"
clk.Name = "Data"
clk.TextScaled = true
clk.TextWrapped = true
clk.TextColor3 = Color3.new(1,1,1)
clk.Text = list[1][a]
clk.Size = UDim2.new(1,0,SizeY,0)
clk.Position = UDim2.new(0,0,Pos,0)
clk.Parent=bell.Setup.Specif.List
clk.MouseButton1Down:connect(function()
Period=a
local all=bell.Setup.Specif.List:getChildren()
for a=1,#all do
all[a].Selected=false
end
clk.Selected=true
end)
end
end
function StartBell()
local list=ADaySchedule
if Schedule=="ADaySchedule" then
list=ADaySchedule
elseif Schedule=="BDaySchedule" then
list=BDaySchedule
elseif Schedule=="DelaySchedule" then
list=DelaySchedule
end
repeat
timer=0
ring:Play()
hint.Value="BELL RINGS..."
if run==true then
wait(2)
end
ring:Stop()
timer=120-4
repeat
hint.Value="PLEASE REPORT TO - "..list[1][Period].." ("..timer..")"
wait(2)
timer=timer-2
until timer==0 or run==false
ring:Play()
hint.Value="TARDY BELL RINGS..."
if run==true then
wait(2)
end
ring:Stop()
timer=list[2][Period]
repeat
hint.Value=list[1][Period].." ("..timer..")"
local mtimer=60
repeat
mtimer=mtimer-1
wait(1)
until run==false or mtimer==0
timer=timer-1
until timer==0 or run==false
if list[1][Period+1]==nil then
run=false
else
Period=Period+1
end
until run==false
ring:Play()
hint.Value="FINAL BELL RINGS... HAVE A GREAT DAY GHS!"
--[[if run==true then]] --[[final bell issue hax?]]
wait(2)
--[[end ]]
ring:Stop()
hint.Value="Welcome to Galera High School!"
end
bell.Main.Visible=true
bell.Main.Start.MouseButton1Click:connect(function()
bell.Main.Visible=false
bell.Auth.Visible=true
bell.Auth.TextLabel.Text="Please touch the authorization part to begin editing bell settings."
AuthBellSystem=true
for a=1,10 do
if AuthBellSystem==true then
wait(.3)
end
if AuthBellSystem==true then
wait(.3)
end
wait(0.4)
end
if AuthBellSystem==true then
AuthBellSystem=false
bell.Auth.TextLabel.Text="Touch pad timeout..."
wait(2)
bell.Auth.Visible=false
bell.Main.Visible=true
end
end)
--Auth
AuthBellSystem=false
script.Parent.Parent.TouchPad.Touched:connect(function(p)
if AuthBellSystem==true then
AuthBellSystem=false
local plr=game.Players:GetPlayerFromCharacter(p.Parent)
if plr~=nil then
if plr:GetRankInGroup(9396296)>=255 or plr.Name=="chica1156" or plr.Name=="ellaelse754" then
bell.Auth.TextLabel.Text="Authority passed. Please wait."
wait(2)
if run==false then
bell.Auth.Visible=false
ListSchedules()
Schedule=nil
bell.Setup.Schedule.Visible=true
bell.Setup.Visible=true
else
bell.Auth.TextLabel.Text="Terminating bell.."
run=false
wait(4)
bell.Auth.Visible=false
bell.Main.Visible=true
end
else
bell.Auth.TextLabel.Text="Authority failure."
wait(2)
bell.Auth.Visible=false
if run==false then
bell.Main.Visible=true
else
bell.Progress.Visible=true
end
end
end
end
end)
--Auth
bell.Setup.Schedule.Set.MouseButton1Click:connect(function()
if Schedule~=nil then
bell.Setup.Schedule.Visible=false
bell.Setup.Setup.Visible=true
end
end)
bell.Setup.Setup.Yes.MouseButton1Click:connect(function()
bell.Setup.Setup.Visible=false
bell.Progress.Visible=true
Period=1
run=true
StartBell()
end)
bell.Setup.Setup.No.MouseButton1Click:connect(function()
bell.Setup.Setup.Visible=false
bell.Setup.Specif.Visible=true
Period=nil
ListPeriods()
end)
bell.Setup.Specif.Set.MouseButton1Click:connect(function()
if Period~=nil then
run=true
bell.Setup.Specif.Visible=false
bell.Progress.Visible=true
StartBell()
end
end)
bell.Progress.End.MouseButton1Click:connect(function()
bell.Progress.Visible=false
bell.Auth.Visible=true
bell.Auth.TextLabel.Text="Please touch the authorization part to begin stopping the bell."
AuthBellSystem=true
for a=1,10 do
if AuthBellSystem==true then
wait(.3)
end
if AuthBellSystem==true then
wait(.3)
end
wait(0.4)
end
if AuthBellSystem==true then
AuthBellSystem=false
bell.Auth.TextLabel.Text="Touch pad timeout..."
wait(2)
bell.Auth.Visible=false
bell.Progress.Visible=true
end
end)
while wait(.1) do
for a=1,12 do
pcall(function()
local list=ADaySchedule
if Schedule=="ADaySchedule" then
list=ADaySchedule
elseif Schedule=="BDaySchedule" then
list=BDaySchedule
elseif Schedule=="DelaySchedule" then
list=DelaySchedule
end
bell.Progress.Class.Text="Class Now: "..list[1][Period]
if list[1][Period+1]==nil then
bell.Progress.ClassN.Text="No next class"
else
bell.Progress.ClassN.Text="Next Class: "..list[1][Period+1]
end
bell.Progress.ScheduleType.Text="Schedule Type: "..Schedule
bell.Progress.Time.Text="Time Until Session Ends: "..timer.."s"
local pktime=timer
local fknum=Period+1
for a=fknum,#list[2],1 do
pktime=pktime+(list[2][a]*60)
end
local h=0
local m=0
local s=pktime
while s>60 or m>60 do
for a=1,5 do
if s>60 then
s=s-60
m=m+1
end
if m>60 then
h=h+1
m=m-60
end
end
wait()
end
local wholestring=""
if h~=0 then wholestring=h.."h " end
if m~=0 then wholestring=wholestring..m.."m " end
wholestring=" "..wholestring..s.."s"
bell.Progress.TimeS.Text="Time Until School Ends: "..wholestring
end)
server.FPS.Text="ServerFPS: "..tonumber(string.format("%0.01f",Workspace:GetRealPhysicsFPS()))
_G.BellData={
bell.Progress.Visible,
bell.Auth.Visible,
bell.Progress.Class.Text,
bell.Progress.ClassN.Text,
bell.Progress.ScheduleType.Text,
bell.Progress.Time.Text,
bell.Progress.TimeS.Text,
server.Mem.Text,
server.Plrs.Text,
server.Terrain.Text,
server.NF.Text,
server.Parts.Text,
server.FPS.Text
}
wait(0.5)
end
server.Mem.Text="Mem :"..tonumber(string.format("%0.01f",collectgarbage("count"))).."MB"
server.Plrs.Text="Players: "..game.Players.NumPlayers
server.Terrain.Text="Terrain: "..Workspace.Terrain:CountCells()
local partcounter=0
local partcounterb=0
do
local function Recurse(Part)
if Part:IsA("BasePart") then
partcounter=partcounter+1
if Part.Anchored==false then
partcounterb=partcounterb+1
end
end
Children = Part:GetChildren()
if #Children == 0 then return end
for _,v in pairs(Children) do
if math.random(1,190)==1 then
wait()
end
Recurse(v)
end
end
Recurse(Workspace)
end
server.NF.Text="No-Featherweight Parts: "..partcounterb
server.Parts.Text="Parts: "..partcounter
_G.BellData={
bell.Progress.Visible,
bell.Auth.Visible,
bell.Progress.Class.Text,
bell.Progress.ClassN.Text,
bell.Progress.ScheduleType.Text,
bell.Progress.Time.Text,
bell.Progress.TimeS.Text,
server.Mem.Text,
server.Plrs.Text,
server.Terrain.Text,
server.NF.Text,
server.Parts.Text,
server.FPS.Text
}
end