Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My chnaged event is not even firing. Ideas?

Asked by 5 years ago
Edited 5 years ago

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

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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)
0
the extar lives is an intvalue jakebball2014 84 — 5y
0
use :GetPropertyChangedSignal("Value") EmbeddedHorror 299 — 5y
Ad

Answer this question