Text Doesn't Show NumberValue

text doesn’t write numbervalue’s value like the text here is “Baseplate’s Health: 100” and if numberValue’s Value - 5 the text is still the same :

clicky = workspace.Baseplate.ClickDetector
plate = clicky.Parent
plateHealth = plate.Health
txt = script.Parent

txt.Text = "Baseplate Health:" .. tostring(plateHealth.Value)
1 Like

The script doesn’t automatically work when the Value changes, you need to have the script detect changes to the value and then tell the script to change the text to the new value. this can be used via .Changed or .GetPropertyChangedSignal (one of the two is correct in this case, i’ll quickly make a code snippet and come back with the correct one.)

something like this should work I believe:

clicky = workspace.Baseplate.ClickDetector
plate = clicky.Parent
plateHealth = plate.Health
txt = script.Parent

txt.Text = "Baseplate Health:" .. tostring(plateHealth.Value)

plateHealth.Changed:Connect(function(Value)
   txt.Text = "Baseplate Health:" .. tostring(Value) -- I am assuming "plateHealth" is an IntValue property.
end)
3 Likes

as @Kyoobuyu_Shurai said, it doesn’t automatically change
another way to do this:

clicky = workspace.Baseplate.ClickDetector
plate = clicky.Parent
plateHealth = plate.Health
txt = script.Parent

txt.Text = "Baseplate Health:" .. tostring(plateHealth.Value)

plateHealth:GetPropertyChangedSignal('Value'):Connect(function()
   txt.Text = "Baseplate Health:" .. tostring(plateHealth.Value)
end)

this does the same thing, just uses :getpropertychangedsignal()

wanna check out my new topic im having trouble with please

Sure, if you Link it.

If you’re done here you should mark whatever solution helped you so that people who see this in the future know what to refer to.

someone gave me solution for it xd but thanks :slight_smile: