My code works, but when I duplicate it and switch it to another part with the same exact properties, it doesn't work

The code that works completely is circled in green, the code in red doesn’t.
All I did was change the hand from the right hand to the left hand
Any thoughts on how to fix it?

It’s inside the run service btw

2 Likes

Your code does not even function properly in the first place. First of all, you are trashing the wait for child result and second of all you are using cframe.new, which is deprecated for cframe.lookat.

You aren’t supposed to put a script in that container.

Where is it supposed to go then?

I’m running the code through runservice.renderstepped and the script is in the StarterCharacterScripts

RunService.RenderStepped only works on the client.
If you are running on the server use .Heartbeat instead.

No worries there, I have it on the client.

Ok, are there any errors in the output?

Just an error stating that it’s trying to index FindFirstChild(“Grip”) with nil, but it stops when I grab an object. That never stopped anything else functioning though.

That means lhold doesn’t exist.
Either that or Grip doesn’t exist (forgot exactly what the error means)

It means I’m not holding anything on the left hand, yet I have lhold as an instance as it should be when I’m grabbing stuff.

Not sure what “UpdateCFrame” is but make sure that it doesn’t rely on it to be a certain hand.
Also make sure that “newcframe” is being set properly

It updates the cframe on the server instead of just the client, and it sets the networkownership to the player.

Ok, good to know.
On a side note (so you don’t come across this problem) make sure you add sanity checks to this.
If you don’t exploiters could literally pick up everything at once and abuse it to fling players.
Also, what exactly is happening? Are things falling onto the ground?

It’s for a vr system I created. Normally you would pick up stuff, and it would just float and then go back to its original position. This event makes it so it will fall and have a visible change in cframe for everyone on the server.

Ok, so what’s the problem? Is it just not working in general (has no effect)?

The first part, the one circled in green works without any issues. The one in red is the same, but for the left hand and it has no effects at all.

Ok, I’ll look at your code again.

Are all your grips and stuff updated for the new hand?

Yes, same goes for the right hand.

hold up, I noticed my mistake, I used FindFirstChild on a remote event

1 Like

that didn’t fix it either, I also switched the waitforchild to findfirstchild

@Chaos_Geo