This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-10-24 09:26:35

mxgphill
New Scratcher
Registered: 2012-10-24
Posts: 1

Including Variables in a line

I'm not sure if there is a way to do this, but if there is, I haven't found it yet. What I'm requesting is a way to include a variable in the middle of a sentence that a sprite is saying. For example, I generate a random value for x. I would like to make it so that a character could say "I need x money." I have found no way to achieve this other than make the character say another line.

Offline

 

#2 2012-10-24 10:29:46

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: Including Variables in a line

say (join [I need ] (join (x) [ money]))
Your welcome.

Last edited by joefarebrother (2012-10-24 10:30:03)


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#3 2012-10-24 16:51:53

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: Including Variables in a line

joefarebrother wrote:

say (join [I need ] (join (x) [ money]))
You're welcome.

I Fixed your grammar, but otherwise, correct.

Last edited by ImagineIt (2012-10-24 16:52:15)

Offline

 

Board footer