that is perfectly fine, in some cases the only viable solutions is to use continue. The only reason i could see this being not preferred is because you wont be able to run any code under continue in the same scope, but it is pretty much the equivalent of doing:
function hi()
local player = script.Parent.Test
if not player then return end -- perfect
--more code under here
end
which is perfectly fine to use - for continue, it would work like this:
while wait() do
local player = script.Parent.Text
if not player then continue end
end
now that i think of it, i seriously wonder how people dealt with coding before continue was a thing, lol
It has to do with readability. Using continue in the example I provided is less clear than just saying if whatever then. You can find a lot of debate on this on Github and other sites.
while wait() do
local user = ai:getTarget()
local head = getHead(user)
if not head then continue
end
-- Stuff
if not foo then continue
end
-- Stuff
if not bar then continue
end
-- Stuff
end