scripting:samples:simpleaxe
Simple Bronze Axe Sample
This simple sample script provides a 'UseItem' event that will check to see if the player is near to some trees and if so, award them with 1 'Wood' item.
//------------------------------------- Bronze Axe Event( "UseItem", "Bronze Axe" ) { $dist = sysGetNearestForest( $gPlayerWorldX,$gPlayerWorldY ) $distM = $dist / 100 if ( $distM < 65 ) { *notifylarge %PLAYER% +1 Wood *choptrees $gPlayerWorldX,$gPlayerWorldY *grantitem %PLAYER% 1 Wood } else { *alert %PLAYER% No suitable trees nearby (Nearest forest = $distM m ) } CancelTransaction() }
scripting/samples/simpleaxe.txt · Last modified: 2020/01/28 17:50 by 127.0.0.1