ID:175824
 
I was wondering if anyone could help me define a variable that represents the first 4 letters/numbers in usr.name?
Erdrickthegreat2 wrote:
I was wondering if anyone could help me define a variable that represents the first 4 letters/numbers in usr.name?

The copytext() proc is most useful when you want to only get fragments of a string. :)

var/first_four = copytext(usr.name,1,5)
In response to Malver
usr is undefined and if i change it to a mob/var i get errors

mob/var

first_four="[copytext(usr.name,1,5)]"

i tried this

mob/var

first_four=copytext(usr.name,1,5)

and this

mob/verb/namer()
var/first_four="[copytext(usr.name,1,5)]"
usr<<"[first_four]"

but none worked..

ETG
In response to Erdrickthegreat2
Erdrickthegreat2 wrote:
usr is undefined and if i change it to a mob/var i get errors

I supplied an example. You did say the pathway was usr.name.

mob/verb/namer()
var/first_four="[copytext(usr.name,1,5)]"
usr<<"[first_four]"

Are you sure? I just tried this, and it works fine.
In response to Malver
lol yeah i just tried it worked =)