Whats wrong with this code

Hello

I am wondering what is wrong with this piece of code. From my view nothing seems wrong. Everything is named correctly the part falls onto the other part in time, and they both can collide.

Is my code wrong?
Thank you

1 Like

Change everything that says game.Workspace to just workspace.

1 Like

the issue is at line 9.

you have

if hit.Name == game.Workspace.wecamt.l then

you should change that to

if hit.Name == "l" then

Because game.Workspace.wecamt.l is not the name of your block, that’s the location.

2 Likes

There’s a typo at line 1. Replace “workspace” with “Workspace”:

game.Workspace.wecamt.f

Your script will also start running when you change “if hit.Name ==”.

1 Like