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

Why won't my script run?

I am making a storage that is able to move without the parts inside stopping it. When I try to use it, it does do anything. It is a regular script and it is inside of a part that is in the workspace. It gives no errors.

local detector = script.Parent
local toggle = true
function Weld()
	if toggle == true then
		for i,v in pairs (detector:GetTouchingParts()) do
			print("the part is" .. v.name)	
		end
	else
		
	end
end
wait(0.1)
Weld()

1 answer

I don't think you can leave 'else' empty. But that might not be it. Also, you only need local if you're using a variable inside a function. So you can remove the "locals" in the beginning.

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