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

How do I convert an int value to a string that can be displayed on a GUI?

I am not that good at scripting, and I am trying to make a simple game. I'd like to make a GUI that displays my money (bitcoin) into a ScreenGui. So like this, just updating all the time. https://gyazo.com/30adb1c8f1281f01f60fd3866108a56d

If I just try to make the value of bitcoin be read onto the GUI, then it says it cannot do it, as it is not a string. This is the code I am using for my money, by the way.

game.Players.PlayerAdded:Connect(function(player)
	
	playersLeft = playersLeft + 1
	
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = player
	
	local bitcoin = Instance.new("IntValue")
	bitcoin.Name = "Bitcoin"
	bitcoin.Value = 0
	bitcoin.Parent = leaderstats
	
	player.CharacterAdded:Connect(function(character)
		character.Humanoid.WalkSpeed = 0
	end)
end)

2 comments

0

Maybe try changing the value to a NumberValue instead of Intvalue.

0

No, that wouldn't solve it. Anyways, the suggestion below solved it. Thanks for the suggestion though!

1 answer

✓ Accepted answer

tostring() will convert any value to a string. Try something like:

local string = tostring(IntValue)

Then set string to your gui's text. And IntValue to your IntValue.

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