local o=game:GetService("\076\105\103\104\116\105\110\103")local v=game.ServerStorage.Bandit local j=workspace.BanditSpawns local S local V;(game.Lighting:GetPropertyChangedSignal("\067\108\111\099\107\084\105\109\101")):Connect(function()if game.Lighting.ClockTime==7 then local o=math.random(1,10)local v=false if o>=5 then v=true end game.ServerStorage.ServerData.Age.Value+=1 game.ServerStorage.ServerData.Day.Value+=1 if V then V:Disconnect()end if game.ServerStorage.ServerData.Day.Value>=5 then if game.ServerStorage.ServerData.HasKeys.Value==false then workspace.Door.Knock:Play()workspace.Door.Sparkles.Enabled=true workspace.Door.ProximityPrompt.Enabled=true S=workspace.Door.ProximityPrompt.Triggered:Connect(function(o)(game.ServerStorage.key:Clone()).Parent=o.PlayerGui workspace.Door.Knock:Stop()workspace.Door.Sparkles.Enabled=false workspace.Door.ProximityPrompt.Enabled=false S:Disconnect()end)end end if game.ServerStorage.ServerData.HasKeys.Value==true then if v==true then workspace.Sound3:Play()game.ReplicatedStorage.Bandit:FireAllClients()repeat task.wait(2.5)local o=game.ServerStorage.Bandit:Clone()o.HumanoidRootPart.CFrame=(j:GetChildren())[math.random(1,#j:GetChildren())].CFrame+Vector3.new(0,10,0)o.Parent=workspace.AttackableNPCS until workspace.Sound3.Playing==false for o,v in ipairs(workspace.AttackableNPCS:GetChildren())do v:Destroy()end for o,v in ipairs(workspace.FloppaBlocker.bandits:GetChildren())do v:Destroy()end game.ReplicatedStorage.Bandit2:FireAllClients()workspace.Sound3:Stop()workspace.Sound:Play()end workspace.Mailbox.Main.Sparkles.Enabled=true workspace.Mailbox.Main.ProximityPrompt.Enabled=true V=workspace.Mailbox.Main.ProximityPrompt.Triggered:Connect(function(o)workspace.Mailbox.Main.Sparkles.Enabled=false workspace.Mailbox.Main.ProximityPrompt.Enabled=false local v=(game.ServerStorage.mailboxthings:GetChildren())[math.random(1,#game.ServerStorage.mailboxthings:GetChildren())]:Clone()v.Parent=o.PlayerGui V:Disconnect()V=nil end)end game.ServerStorage.TempData.CanGiveRent.Value=true workspace.Roommate.Head.Dialog["\071\105\109\109\101 \114\101\110\116"].ResponseDialog="\065\108\114\105\103\104\116"end end)while true do task.wait(.05)o:SetMinutesAfterMidnight(o:GetMinutesAfterMidnight()+.5)end
--// bolekinds

local Time = game:GetService("Lighting")
local Bandit = game.ServerStorage.Bandit
local BanditSpawns = workspace.BanditSpawns
local con
local mailboxcon

game.Lighting:GetPropertyChangedSignal("ClockTime"):Connect(function()
	if game.Lighting.ClockTime == 7 then
		local randomNum = math.random(1, 10)
		local banditRaid = false
		if randomNum >= 5 then
			banditRaid = true
		end
		game.ServerStorage.ServerData.Age.Value += 1
		game.ServerStorage.ServerData.Day.Value += 1
		if mailboxcon then
			mailboxcon:Disconnect()
		end
		if game.ServerStorage.ServerData.Day.Value >= 5 then
			if game.ServerStorage.ServerData.HasKeys.Value == false then
				workspace.Door.Knock:Play()
				workspace.Door.Sparkles.Enabled = true
				workspace.Door.ProximityPrompt.Enabled = true
				con = workspace.Door.ProximityPrompt.Triggered:Connect(function(plr)
					game.ServerStorage.key:Clone().Parent = plr.PlayerGui
					workspace.Door.Knock:Stop()
					workspace.Door.Sparkles.Enabled = false
					workspace.Door.ProximityPrompt.Enabled = false
					con:Disconnect()
				end)
			end
		end
		if game.ServerStorage.ServerData.HasKeys.Value == true then
			if banditRaid == true then
				workspace.Sound3:Play()
				game.ReplicatedStorage.Bandit:FireAllClients()
				repeat
					task.wait(2.5)
					local bandit = game.ServerStorage.Bandit:Clone()
					bandit.HumanoidRootPart.CFrame = BanditSpawns:GetChildren()[math.random(
						1,
						#BanditSpawns:GetChildren()
					)].CFrame + Vector3.new(0, 10, 0)
					bandit.Parent = workspace.AttackableNPCS
				until workspace.Sound3.Playing == false
				for i, v in ipairs(workspace.AttackableNPCS:GetChildren()) do
					v:Destroy()
				end
				for i, v in ipairs(workspace.FloppaBlocker.bandits:GetChildren()) do
					v:Destroy()
				end
				game.ReplicatedStorage.Bandit2:FireAllClients()
				workspace.Sound3:Stop()
				workspace.Sound:Play()
			end
			workspace.Mailbox.Main.Sparkles.Enabled = true
			workspace.Mailbox.Main.ProximityPrompt.Enabled = true
			mailboxcon = workspace.Mailbox.Main.ProximityPrompt.Triggered:Connect(function(plr)
				workspace.Mailbox.Main.Sparkles.Enabled = false
				workspace.Mailbox.Main.ProximityPrompt.Enabled = false
				local c = game.ServerStorage.mailboxthings
					:GetChildren()[math.random(1, #game.ServerStorage.mailboxthings:GetChildren())]
					:Clone()
				c.Parent = plr.PlayerGui
				mailboxcon:Disconnect()
				mailboxcon = nil
			end)
		end
		game.ServerStorage.TempData.CanGiveRent.Value = true
		workspace.Roommate.Head.Dialog["Gimme rent"].ResponseDialog = "Alright"
	end
end)

while true do
	task.wait(0.05)
	Time:SetMinutesAfterMidnight(Time:GetMinutesAfterMidnight() + 0.5)
end
