When I call it, it just never continues below it.
(Part of the code is put into a comment as I was testing it w/o datastores)
Code:
--Handlers
local DataStoreService = game:GetService("DataStoreService")
local DataPlayer = DataStoreService:GetDataStore("PlayerData")
HttpService = game:GetService("HttpService")
--Chat detection
local Admins = {3208036948} --user IDs
local Prefix = "/" --chat prefix
local Power = script.TronEnabled
local Variant = nil
local coroutineTitantron = nil
local coroutineLEDs = nil
local TronFiles = {
["Titantron Data"] = {
["HasIntro"] = true;
["Wait time"] = 0.5;
["Intro"] = {
["TV"] = {1,2,3};
["TVTop"] = {};
["Side3"] = {};
["Side4"] = {};
["Screen1"] = {};
["Screen2"] = {}
};
["Main"] = {
["TV"] = {4,5,6};
["TVTop"] = {};
["Side3"] = {};
["Side4"] = {};
["Screen1"] = {};
["Screen2"] = {}
}
};
["LED colors"] = {
["Color1"] = 0,
["Color2"] = 0
}
}
local function RunTV(Data,Type)
local ImportedData = Data
local IntroIDs = Data["Titantron Data"].Intro.TV
local MainIDs = Data["Titantron Data"].Main.TV
local WaitTime = Data["Titantron Data"]["Wait time"]
local HasIntro = Data["Titantron Data"].HasIntro
if HasIntro == true and Type ~= "Main" then
for i,ID in pairs(IntroIDs) do
if Power.Value == false then
print("AAAA")
break
end
print(ID)
wait(WaitTime)
end
end
while wait() do
for i,ID in pairs(MainIDs) do
if Power.Value == false then
print("AAAA")
break
end
print(ID)
wait(WaitTime)
end
end
end
--[[script.RemoteEvent.OnServerEvent:Connect(function(player,user,TitantronNumber,option)
Power.Value = false
wait(0.5)
print(Power)
--fetch user's titantron data depending on the loadout
local success,Data = pcall(function()
return DataPlayer:GetAsync(player.UserId)
end)
if success then
local DataImport = Data
if option == "Intro" then
Variant = "Intro"
elseif option == "Main" then
Variant = "Main"
end
--TV
Power.Value = true
--coroutine.create(RunTV)
RunTV(DataImport,Variant)
end
end)
]]--
Power.Value = true
local connection = RunTV(TronFiles,"Intro")
print("eee")
wait(1)
Power.Value = false