Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How could i check if a part moves, and if it does, move a cloned part to its original position?

I really want to be able to add a system that actively checks if a part moved from its original position (i have it cloned in server storage) and then clone and parent the original clone to the workspace, then effectively "respawn" that part. But i dont know how?

Thanks in advance - Irish

1 answer

✓ Accepted answer

First, you can start off by using a method called GetPropertyChangedSignal() Then you can store the positions part in a variable -- Which we can get later

Once the position of that part is changed it will call the function and then all we do is set your clone parts position to the parts original position then all you have to do is update the position of the old parts.

local part = game.Workspace.Part -- This is the part you are going to track
local clonedPart -- Set this equal to the cloned part your trying to reference
local previousPosition = part.Position

part:GetPropertyChangedSignal("Position"):Connect(function()
	clonedPart.Position = previousPosition
	previousPosition = part.Position
end)

Instance:GetPropertyChangedSignal()

If this helps an upvote or solve would be appreciated. Good luck!

  • Best Regards, - Syn

2 comments

0

CFrame and properties related to it such as Position don't fire the Changed signal or signals related to the Changed signal

0

Oh really? I was going off a hunch without manually calling a function or firing remotes when you move them? is there any other way?

This discussion is preserved as it was. New answers, comments, and votes are closed.