#Why does this left while loop crash the game but the right one doesn't?

27 messages · Page 1 of 1 (latest)

rugged tartan
pine solstice
#

While 1==1 runs without any delay

#

If you don’t want lag, change it to while task.wait()

rugged tartan
#

I tried adding a wait(1) in the loop but it did nothing to fix it

pine solstice
#

It runs it every frame

#

Try doing while task.wait() instead of while 1==1 and then check it out

#

Might work

pine lance
#

on the left you connecting a event, you dont need to do a while loop, js call it one time

#

and task.wait > wait

rugged tartan
#

But when I jump off and back on the part again it doesn't change color again

pine lance
#

cuz you're only calling the x,y and z variable one time

#

u should change it on touched func

rugged tartan
#

What's that mean

pine lance
#

that means that on the touched event is where do you need to create the x, y and z color variables

rugged tartan
#

Change it to touchedPart.onTouch:connect?

#

Ohhh

rugged tartan
#

Like just the feet

pine lance
#

ye u cant do that if the part hasnt the name for example of RightFoot u doesnt do anything, example:

if hit.Name ~= "RightFoot" then return end;

iron jewel
#

oh ppl alr responded

#

oops

rugged tartan
shadow cairn
rugged tartan
#

It's for an obby I'm making as I learn code

#

Pretty much one or 2 new obstacles every lesson