Speech work

Need help with your JScripts? Got questions concerning the DFNs? Come forward, step inside :)
Post Reply
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

Speech work

Post by dragon slayer »

So I'm trying out speech a little i was working on random words to be said. here is the code i got


Code: Select all

function randomString()
{
        var Msg1 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"
        var string_length = 8;
        var randomstring = '';

        for (var i=0; i<string_length; i++) 
        {
		var rnum = Math.floor(Math.random() * Msg1.length);
		randomstring += Msg1.substring(rnum,rnum+1);
        }
}
        pCharacter.TextMessage( randomString ); 
I'm not sure what I'm doing wrong but the npcs spits every thing out LOL instead of just saying random letters and numbers above head
Post Reply