Deprecated Code, Need Help Replacing / RemoteEvents not Firing

I use this code in a Character Customization script in my ServerScriptService. It works in my own game on my own model, however when using it on my friend’s game on a different model (of similar design) it doesn’t function. My assumption is that it’s because it’s deprecated - though RemoteEvents in general are failing to fire on this game and I’m not sure why.
I need help fixing this code and possibly figuring out why RemoteEvents aren’t functioning on my friend’s game. Please answer quick and thanks in advance! <3

Also, example of one of the RemoteEvents not working. I hear this may be because we’re on Team Create, but surely that can’t be why?

the remote event on the server might just not bbe loaded in, i’ve used :SetPrimaryPartCFrame before, it doesn’t have any issues

try doing game:GetService("ReplicatedStorage").MorphEvent.OnServerEvent

1 Like

In which script, the Customization Script or the Morph Script?

It might not be working because the other model may not have a primary part.

To update your code and avoid deprecated functions, use Model:MoveTo or PVInstance:PivotTo instead of SetPrimaryPartCFrame.

1 Like

The problem is that I don’t know how to make that replacement in my script without breaking things. I’m not an experienced programmer and I’ve basically winged everything up until this point.

Replace SetPrimaryPartCFrame with PivotTo. MoveTo moves the primary part to the specified position, but if there are obstructions, the model will be moved upwards until it’s clear. For your case, I recommend using PivotTo, as it performs similarly but does not adjust the model’s height, just like SetPrimaryPartCFrame.

You can set the primary part of a model in the properties window when the model is selected.

2 Likes

in here
image

if it doesn’t work, do what mr cardboard said

set a primary part, if it has a primary part, just use pivot to, it requires no changes to your code, just replace :SetPrimaryPartCFrame with :PivotTo

2 Likes

Thanks a ton! This easily fixed my game. Both of you were a huge help, I can’t believe I missed something so simple. All of my events are working just fine now.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.