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

My chnaged event is not even firing. Ideas?

So I am making an indiana jones themed adventure game and am trying to make an extra lives GUI but for some reason their is no print statement and the text is not changing either. I assume the problem lies in the changed event but I cannot be sure. I tried everything and I need help! I also double checked the hierarchy three times and it adds up.

script.Parent.ExtraLives.Changed:Connect(function()
	print("changed")
	wait()
	script.Parent.HealthBars.ExtraLivesText.Lives.Text = "+"..script.Parent.ExtraLives.Value
end)
  

1 answer

Changed doesnt work on a gui as far as i know, so use :GetPropertyChangedSignal(your property)

for example

--for a gui
local gui=game.Players.LocalPlayer.PlayerGui.Some.Random.Gui


gui:GetPropertyChangedSignal("Text"):Connect(function()

--your code here




end)

--for a value

local val=game:GetService("ReplicatedStorage"):WaitForChild("Value")
val:GetPropertyChangedSignal("Value"):Connect(function()





end)

2 comments

0

the extar lives is an intvalue

0

use :GetPropertyChangedSignal("Value")

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