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

Why doesn't my tostring work?

Here is the script.


local player=game.Players.LocalPlayer local val=tostring(player.Inventory.Wood)

script.Parent.Text=val.Value


There is a DataStore script that inserts the values into the player. Inventory and Wood are Number Values.

1 comment

0

In addition to Pyrondon's answer, I also highly suggest using the WaitForChild method: http://wiki.roblox.com/index.php?title=API:Class/Instance/WaitForChild

1 answer

✓ Accepted answer

You're gonna want to use tostring() on the value, not the value object. Assuming player.Inventory.Wood exists.

local player = game.Players.LocalPlayer
local val = player.Inventory.Wood

script.Parent.Text = tostring(val.Value)

Hope this helped.

2 comments

0

Thank you so much!

0

No problem.

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