[FIXED] dice and cup script

Here we stuff all the bugs we've managed to squash/squish/squelch.
Locked
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

dice and cup script

Post by dragon slayer »

I get this error msg when trying to use they dice and cup script

ERROR JS script failure: script Number <5020> Message <referenceError:
iDice1 is not defined

ERROR: filename: ./js/items/diceandcup.js
line number 9
error erroroneous line: <null>
token ptr: <null>
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

Post by dragon slayer »

Nevermind i fixed it :)

here is the fix for dice and cup

Code: Select all

function onUseChecked( pUser, iUsed )
{ 
	var iDice1 = RandomNumber( 1, 6 );
	var iDice2 = RandomNumber( 1, 6 );
	
	var pName = pUser.name;
	
	if( iUsed.container != null )
		pUser.EmoteMessage( pName+" rolls the dice and gets a "+iDice1+" and a "+iDice2+"." );
	else
		iUsed.TextMessage( pName+" rolls the dice and gets a "+iDice1+" and a "+iDice2+"." );
	return false;
}
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Doh. What a silly mistake to made, whoever made it. :oops:
-= Ho Eyo He Hum =-
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

Post by dragon slayer »

hehe easy mistake :)

I'm working ona slotmachine script for you :) using your dice and cup code and adding some tweaks i should have a nice slot machine
Locked