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

I am trying to change text on an int value but ge no error?

I am making an indiana jones themed adventure game and am trying to make an extra lives GUI that changes to an int value when the int value changes but for some reason the GUI text is not switching values. I get no error either.

local rtl = script.Parent.RealTimeLives
local el = script.Parent.ExtraLives
local healthbars = script.Parent.HealthBars
local elt = healthbars.ExtraLivesText.Lives.Text 

el.Changed:Connect(function()
	wait()
	elt = "+"..el.Value
end)

1 comment

0

try wrapping the text you are changing it to with a tostring

2 answers

try adding tostring() to 'el.Value' on line 8

local rtl = script.Parent.RealTimeLives
local el = script.Parent.ExtraLives
local healthbars = script.Parent.HealthBars
local elt = healthbars.ExtraLivesText.Lives.Text 

el.Changed:Connect(function()
    wait()
    elt = "+".. tostring(el.Value)
end)

use a tostring(). it casts the input to a string.

local a=1
print(tostring(a))

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