I have this code where a raid starts and then soldiers arrive with a countdown but the for loop of it isn't working. Why? i put print in it, it worked. here is code:
oldier1Clone.Humanoid.Died:Connect(function()
wait(1.5)
workspace.ApartmentHouse.EntranceDoor.ProximityPrompt.Enabled = true
local timer = 7
for i = timer, 1, -1 do
--wait(1)
ReplicatedStorage.TimerStatus.Value = "Soldier Incomming in: " .. i
if ReplicatedStorage.TimerStatus.Value == "Soldier Incomming in: 1" then
wait(1)
ReplicatedStorage.TimerStatus.Value = "Soldier Incomming in: 0"
local newSoldier = Soldiers.Soldier4:Clone()
newSoldier.Damage.Value = 35
newSoldier.Parent = workspace.NPCS
newSoldier.Humanoid.MaxHealth = 10000
newSoldier.Humanoid.Health = 10000
end
if workspace.ApartmentHouse.EntranceDoor.ProximityPrompt.Triggered then
break
end
end
soldier2Clone.Parent = workspace.NPCS
soldier2Clone:MoveTo(workspace.ApartmentHouse.EnterDoor.CFrame.Position)
end)

2 comments
Click "View Source" on the top right corner of the code if you have trouble reading it
thanks it worked!