Method -- "GetPropertyChangedSignal" Not Working

:GetPropertyChangedSignal(“VaIue”) Not Work For ValueObject
I Had Research And I Don’t Fin Any Problem

My Script
local player = game.Players.LocalPlayer
local stats = player:WaitForChild("valuestats")
local leader = player:WaitForChild("leaderstats")
local streak = stats:WaitForChild("Streak")
local coins = leader:WaitForChild("Coins")
local tickets = stats:WaitForChild("FloorTicket")

local streaktext = script.Parent.Streak
local coinstext = script.Parent.Coins
local tickettext = script.Parent.FloorTicket

local function update()
    streaktext.Text = streak.Value .. " Floor"
    coinstext.Text = coins.Value .. "⊕"
    tickettext.Text = tickets.Value .. "🅵"
end
update()

streak:GetPropertyChangedSignal(“VaIue”):Connect(update)
coins:GetPropertyChangedSignal(“VaIue”):Connect(update)
tickets:GetPropertyChangedSignal(“VaIue”):Connect(update)

I Been Fining Any Bugs:GetPropertyChangedSignal(“VaIue”)
It Not Firing update() When The Value Changed.
Please Help Me.

Add prints inside the update function to check if its running at all. Also try formatting differently to see if it randomly works.

streak:GetPropertyChangedSignal(“Value”):Connect(function()
update()
end)

Make sure its a local script if u doing this

1 Like

I Added No Output. Here Recent:

1 Like

So you mean you added prints and it didnt show that it ran at all?

Use .Changed instead

streak.Changed:Connect(update)

actually im pretty sure its because you’re not passing anything into your update function
you’re still using the old values of streak when it was defined previously
you need to pass the new value as a parameter for it to update properly

actually disregard this im stupid

It Kinda Lagy. And Won’t Work.

Hello, when you’re calling streak:GetPropertyChangedSignal("VaIue") you’re using a capital I instead of a lowercase l.

Here is the fixed script.

local player = game.Players.LocalPlayer
local stats = player:WaitForChild("valuestats")
local leader = player:WaitForChild("leaderstats")
local streak = stats:WaitForChild("Streak")
local coins = leader:WaitForChild("Coins")
local tickets = stats:WaitForChild("FloorTicket")

local streaktext = script.Parent.Streak
local coinstext = script.Parent.Coins
local tickettext = script.Parent.FloorTicket

local function update()
    streaktext.Text = streak.Value .. " Floor"
    coinstext.Text = coins.Value .. "⊕"
    tickettext.Text = tickets.Value .. "🅵"
end

update()
streak:GetPropertyChangedSignal("Value"):Connect(update)
coins:GetPropertyChangedSignal("Value"):Connect(update)
tickets:GetPropertyChangedSignal("Value"):Connect(update)
1 Like

after looking at your code I am seeing that you are using an “i” for Value instead of an l

1 Like

Hello, when you’re calling streak:GetPropertyChangedSignal("VaIue") you’re using a capital I instead of a lowercase l.

great minds think alike

1 Like

genuine question- how do you mistake an L for an I? In the default code editor the font is set so that they are very distinct from each other

I Code In Notepad Or You Can Say I Code On A Phone And You Know I Caplock My Word So When I Go On PC And Paste. I Won’t Nocited Bc It Was My 4 Day Deadline On The Project. So That How-

Value instances already have a built-in “Changed” event that fires whenever the value instance’s “Value” property changes, the new value is subsequently passed to any function connected to it. Additionally, you should have a different function handle each value change.

local function updatestreak(value)
    streaktext.Text = value .. " Floor" --no need to index streak's "Value" property as the new value is passed as an argument to the function
end

local function updatecoins(value)
    coinstext.Text = value .. "⊕"
end

local function updateticket(value)
    tickettext.Text = value .. "🅵"
end

streak.Changed:Connect(updatestreak)
coins.Changed:Connect(updatecoins)
tickets.Changed:Connect(updateticket)
update()

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