I want to know how to make a while true function to see if an object still exist. If the object exists, then it keeps running. I thought of this but it was kinda wierd.
1 | while game.Workspace:FindFirstChild( "Arrow" ) do |
2 |
3 | end |
Its simple, start the loop and use if ...:FindFirstChild(...) then
Here is a example:
1 | while true do -- Start a loop (Do not use while wait() do, its not a good way.) |
2 | if workspace:FindFirstChild( "ITEM" ) then -- Item location |
3 | -- Your code here. |
4 | else |
5 | break -- End loop if object not found |
6 | end |
7 | wait( 0.3 ) -- For no bugs / lag in game |
8 | end |
But is better use .Changed
Hope it helped :)
Errors? tell-me on comments.
Wiki pages:
While true do wait() if game.Workspace.Part ~= nil then --Checks if the part is there ' --your code goes else --if the part is not there break --the loop will break end end