Issue with GetPropertyChangedSignal not firing

In my game I have a little notice box that appears when you get items / other events and plays a sound. I have a blank template for the notification that actives when the parent is changed into the gui frame where they’re displayed. This worked well, but I recently added another place to my game and when bringing this over to the new place it just completely stopped working.

So far I’ve tried to change the event to .changed instead but also encountered the same issue with the event not firing. Using breakpoints to check what happening shows that it’s activating but then stepping over the function.

Here’s the code I’m using

local template = script.Parent
local player = game.Players.LocalPlayer
local Character = player.Character or player.CharacterAdded:Wait()
local debris = game:GetService("Debris")

template:GetPropertyChangedSignal("Parent"):Connect(function()
	-- loads in item get sound
	local ItemSound = Instance.new("Sound", Character)
	ItemSound.Name = "ItemSound"
	ItemSound.SoundId = "rbxassetid://3418223760"
	
	-- makes notification visible
	template.Visible = true
	Character.ItemSound:Play()
	debris:AddItem(script.Parent, 5)
	debris:AddItem(ItemSound,1)
end)

2 Likes

This is most likely because of Deferred Engine Events: Rollout Update.

Instead of detecting when the parent is changed like this, can’t you use this code in the sections where you set the parent?

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