I made an escape game with a boss in it. When you defeat the boss, a blue portal should open up in the boss-fighting room. But it didn't. I tried using a while true do and repeat until loops so that the portal could appear but it does not. It does not even print the words into the command output when it is defeated, it just continues to print "Alive".
Code:
local health = game:GetService("Workspace").TS4.bossnpc.Humanoid.Health
game:GetService("ReplicatedStorage").Timesplitters.BossAppear.Event:Connect(function()
while health > 0 do
wait(1)
print("Alive")
if health <= 0 then
game:GetService("ReplicatedStorage").Timesplitters.BossLose:Fire()
print("Fired!")
break
end
end
end)
