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

Attempt to call a string value

It's in this script:

leader = game.Workspace:WaitForChild("LEADERBOARDS")
myname = leader:WaitForChild("5DistanceName")
myval = leader:WaitForChild("5Distance")

while wait(2) do
	script.Parent.Text = (tostring(myname.Value)" :: "..tostring(myval.Value)) -- ERROR HERE
end

The value of myval is a number, the value of myname is a string and if not then it is "-".

What is wrong?? I get this: attempt to call a string value

1 answer

✓ Accepted answer

On line six, you have a syntax error. You forgot to concatenate the string.

 script.Parent.Text = (tostring(myname.Value).." :: "..tostring(myval.Value)) -- ERROR HERE

4 comments

0

Ah god I'm such a moron!!!! Thanks!

0

Jw, when is the next contest?

0

You mean Ludum Dare?

0

I disagree Kenetec, this is not a syntax error. The expression " print "Hello!" " is valid - it basically calls print with argument "Hello". This is also what happens here. However, what TomsGames is doing here is calling " :: " on the result of tostring - a string - and is thus "calling a string value".

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