GetPropertyChangedSignal() Is not firing at all

The problem is very simple, however it is still confusing me a ton.
In a model, I have a script as following:

script.Parent:GetPropertyChangedSignal("Parent"):Connect(function()
	print("Parent Was Changed, Server")
	local player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
	if player then
		print("Equipped, Server")
	end
end)

This script was meant to be a test, and the event isn’t firing at all.
This is the script that sets the parent:

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player, model)
	model:Clone().Parent = player.Character
end)

The parent setting works perfectly fine, and it shows up inside the player’s character during the game. It’s just that the GetPropertyChangedSignal() isn’t firing.

Any help is appreciated, as I honestly don’t know what the issue is with this. Many Thanks.

Is this script on the model that’s being cloned?

1 Like

:GetPropertyChangedSignal() doesn’t work for every property such as position, CFrame, etc. The same most likely applies for the Parent property.

Your best bet is to just do the code in the same script as when you clone it or keep that script, but in a loop, check to see when the parent changes (which might create more lag than the other option).

2 Likes

Instance:GetPropertyChangedSignal() actually does work with the Parent property. The script in the model isn’t running until it is parented to the character, so the event doesn’t fire.

try using

script.Parent.AncestryChanged:Connect(function()
	print("Parent Was Changed, Server")
	local player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
	if player then
		print("Equipped, Server")
	end
end)