Ok so the payday thing is not working for some reason but it shows no script errors it counts down to 1 then does not pay.
function onPlayerEntered(newPlayer)
wait(0.5)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
local cash = Instance.new("IntValue")
cash.Name = "Cash"
cash.Value = 0
cash.Parent = stats
stats.Parent = newPlayer
end
game.Players.PlayerAdded:connect(onPlayerEntered)
time = 150
while true do
wait(1)
time = time - 1
if (time == 0) then
time = 180
players = game.Players:GetChildren()
for i=1, #players do
if (players[i]:findFirstChild("leaderstats")) then
if game.Players.LocalPlayer.TeamColor == game.Teams.Citizens.TeamColor then -- Citizens
players[i].leaderstats.Cash.Value = players[i].leaderstats.Cash.Value + 50
elseif game.Players.LocalPlayer.TeamColor == game.Teams["Department of Corrections"].TeamColor then -- Dep of Corr
players[i].leaderstats.Cash.Value = players[i].leaderstats.Cash.Value + 150
elseif game.Players.LocalPlayer.TeamColor == game.Teams["Norfolk City Fire & Rescue"].TeamColor then -- Fire and Rescue
players[i].leaderstats.Cash.Value = players[i].leaderstats.Cash.Value + 100
elseif game.Players.LocalPlayer.TeamColor == game.Teams.Visitor.TeamColor then -- Visitor
players[i].leaderstats.Cash.Value = players[i].leaderstats.Cash.Value + 75
elseif game.Players.LocalPlayer.TeamColor == game.Teams["NCPD SWAT"].TeamColor then -- NCPD SWAT
players[i].leaderstats.Cash.Value = players[i].leaderstats.Cash.Value + 250
elseif game.Players.LocalPlayer.TeamColor == game.Teams["Norfolk City Police"].TeamColor then -- Norfolk City Police
players[i].leaderstats.Cash.Value = players[i].leaderstats.Cash.Value + 125
end
end
end
end
playersa = game.Players:GetChildren()
for i=1, #playersa do
playersa[i].PlayerGui.Norfolk_v1.Cash.TextLabel.Text = "Payday In: " .. tostring(time)
end
end
I hope someone can help me out with this!

3 comments
Please put your whole code in the lua formatting option. I can't keep track of this.
Yes, this is quite impossible to read. Also, maybe cut down some of the code and just show the area you think is the problem.
I just put into a code block sorry about that.