Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Something pauses my script from continuing?

so i made this one script in roblox for a platformer game that detects if a player is in a object stored in a folder and something discontinues my script from going further. I already figured out it was a while true do but does anyone know how you would make it so the script ignores the while true do but it still continues searching for the objects? Heres the code:

for _, object in pairs(file) do
		local block = object
-- not important here
		
		
		
		
print(object.Name)
print("hitbox of object currently is:" .. top .. bottom .. left .. right .. back .. front)
while true do
			wait()
	--detection for inside i dont want to paste it it took some effort
				print("works")
				object.LocalTransparencyModifier = 0.5
				else
				object.LocalTransparencyModifier = 0
				end
	end
end

1 answer

it is because of the "while true do" part, the way around this is by spawning a thread and putting the while true do inside of this, like so:

spawn(function()
	while true do
		--stuff here
	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.