Hello, I have a while true do in a script but it won’t run for some reason.
Also might be an issue with the coroutine. Here is my code:
local frame = script.Parent
local Player = game:GetService("Players").LocalPlayer
Player.CharacterAdded:Wait()
local char = Player.Character
local MaxOxy = 300
local CurrentOxy = 300
local oxyDrain = coroutine.create(function()
task.wait(0.)
CurrentOxy -= 1
print(CurrentOxy)
end)
while true do
task.wait()
coroutine.resume(oxyDrain)
frame.Size.X.Offset = CurrentOxy
if CurrentOxy < 1 then
char.Humanoid.Health = 0
Player:Kick("bruh u didn't breath lol")
end
end