Hello. This is the server script of a collidable block. It doesn't output anything when I touch it OR when I don't touch it. That means that the for loop doesn't even work. Why?

local touchie=script.Parent:GetTouchingParts()
while true do
	for i,v in pairs(touchie) do
		print("The for loop works, cool")
		yay=v.Parent:WaitForChild("Humanoid")
		if yay then
			game.GetService("Players"):GetPlayerFromCharacter(yay.Parent).invincibility.value=true
			print("This message=giant success")
		end
	end
	wait(0.01)
end

5 comments

0

Try putting touchie in the while loop

0

zboi what do you mena by that?

0

he means to write local touchie = script.Parent.:GetTouchingParts() inside the while loop

0

OMG WAIT THAT MIGHT BE IT

0

Aaaand nope it still doesn't work