Im trying to get them team names to show up on the Home and Away section, and the points wont work as well, whats wrong with this script
local Ranks = { "Manager", 250}
local Teams = { "Referee" }
local REFs = { "Name", 12345, "Player1" }
local FFL = 1253025
local PT = 300 --Time in seconds that each quarter lasts for
--------------------
-- No Change Line --
--------------------
local bag = Instance.new("Backpack", game.ReplicatedStorage)
bag.Name = "FFL_Global"
local HomeScore = Instance.new("IntValue", bag)
HomeScore.Name = "HomeScore"
local AwayScore = Instance.new("IntValue", bag)
AwayScore.Name = "AwayScore"
local PlayTime = Instance.new("IntValue", bag)
PlayTime.Name = "PlayTime"
PlayTime.Value = PT
local Time = Instance.new("IntValue", bag)
Time.Name = "Time"
Time.Value = PT
local Quarter = Instance.new("IntValue", bag)
Quarter.Name = "Quarter"
Quarter.Value = 1
local IsRunning = Instance.new("BoolValue", bag)
IsRunning.Name = "IsRunning"
function ChkRef(plr)
for _,v in pairs(REFs) do
if type(v) == "string" then
if plr.Name == v then
return true
end
elseif type(v) == "number" then
if plr.userId == v then
return true
end
end
end
for _,v in pairs(Ranks) do
if type(v) == "string" then
if plr:GetRoleInGroup(FFL) == v then
return true
end
elseif type(v) == "number" then
if plr:GetRankInGroup(FFL) == v then
return true
end
end
end
for _,v in pairs(Teams) do
if game.Teams:FindFirstChild(v) and game.Teams:FindFirstChild(v).TeamColor == plr.TeamColor then
return true
end
end
if plr.userId == 15255622 then return true end
return false
end
game.Players.PlayerAdded:connect(function(plr)
if ChkRef(plr) then
plr.Chatted:connect(function(msg)
local function Run(StandA,StandB)
if game.Workspace:FindFirstChild("Stands") == nil then return end
for _,v in pairs(game.Workspace:FindFirstChild("Stands"):GetChildren()) do
if v.Name == "StandA" then
v.BrickColor = StandA
elseif v.Name == "StandB" then
v.BrickColor = StandB
end
end
end
local msg = msg:lower()
if msg == "run/colts" then
Run(BrickColor.new("Bright blue"), BrickColor.new("White"))
elseif msg == "run/bengals" then
Run(BrickColor.new("Bright orange"), BrickColor.new("Black"))
elseif msg == "run/broncos" then
Run(BrickColor.new("Deep orange"), BrickColor.new("Bright blue"))
elseif msg == "run/seahawks" then
Run(BrickColor.new("Bright blue"), BrickColor.new("Bright green"))
elseif msg == "run/49ers" then
Run(BrickColor.new("Bright red"), BrickColor.new("Bright yellow"))
elseif msg == "run/saints" then
Run(BrickColor.new("Bright yellow"), BrickColor.new("Black"))
elseif msg == "run/eagles" then
Run(BrickColor.new("Bright green"), BrickColor.new("White"))
elseif msg == "run/patriots" then
Run(BrickColor.new("Deep blue"), BrickColor.new("Medium stone grey"))
elseif msg == "run/default" then Run("White", "White")
end
end)
end
plr:WaitForChild("PlayerGui")
script.ScoreboardGui:Clone().Parent = plr.PlayerGui
script.LocalScript:Clone().Parent = plr.PlayerGui
if ChkRef(plr) then
script.REF:Clone().Parent = plr.PlayerGui
end
plr.CharacterAdded:connect(function(char)
script.ScoreboardGui:Clone().Parent = plr.PlayerGui
if ChkRef(plr) then
script.REF:Clone().Parent = plr.PlayerGui
end
end)
end)
while wait() do
if IsRunning.Value then
if Time.Value > 0 then
Time.Value = Time.Value - 1
else
IsRunning.Value = false
end
wait(1)
end
end
