Scripting

Join Discord

timesplitter

Dedicated Member
Dedicated Member
Dec 11, 2010
88
0
32
Kinda new, well never done before lol, just need to know how to script so i could double click a gold chest and the 10m go into bag rather than having to use an npc.

any help is great, i just need to see a script so i could hopefully learn to script other things.

As i said, any help is much appreciated :)
 

Gezza

Golden Oldie
Golden Oldie
Sep 23, 2008
2,201
61
155
uk
Ok in qfuntion you can have...

[@StdModeFunc1]
#IF
checkitem GoldBar 1
#ACT
take GoldBar 1
give gold 1000000
break

Then in sql, stditem database find the goldbar and change the stdmode to 31 and annicount to 1.

do the same for gold chest but put [@StdModeFunc2] and in annicout 2 and change the script too. You can do the same for exp scrolls, pets and what ever..
 
Upvote 0

timesplitter

Dedicated Member
Dedicated Member
Dec 11, 2010
88
0
32
Ok in qfuntion you can have...

[@StdModeFunc1]
#IF
checkitem GoldBar 1
#ACT
take GoldBar 1
give gold 1000000
break

Then in sql, stditem database find the goldbar and change the stdmode to 31 and annicount to 1.

do the same for gold chest but put [@StdModeFunc2] and in annicout 2 and change the script too. You can do the same for exp scrolls, pets and what ever..

wow n1, this means with a chest dbl click will get u 2 bundles of 5 bars or will give 10 bars?

this looks fcking confusing as hell lol. is there anywhere on here that has a complete guide how to script for beginners? lol
ta
 
Upvote 0

Anonlol

LOMCN Veteran
Veteran
Feb 25, 2010
574
14
104
That script is for a gold bar, the stmodefunc 1 means any items with anicount 1 have this efftect if they have stdmode set to 31 (This means will dissapear when double clicked)

[@StdModeFunc1]
#IF
checkitem GoldChest 1
#ACT
take GoldChest 1
give gold 10000000
break

Thats for your goldchests.

Just remember, the principles of scripting - #IF #ACT #SAY #ELSEACT #ELSESAY ie

#IF
Condition = yes
#ACT
Perform action
#ELSESAY
Sorry, condition not met
 
Upvote 0

IceMan

Hero's Act Mir 2
Legendary
Apr 17, 2003
8,544
2
370
350
Those are good starting point but there is no gold checks, if you dont want players to lose gold you must use checks.

[@StdModeFunc(60)]
#IF
checkgold 499000001
#SAY
You cannot Exchange goldbar into money.\
your bankbalance would exceed its limit.\ \
<Cancel/@exit>
#ACT
GIVE GoldBar 1
BREAK
#ELSEACT
give gold 1000000
SENDMSG "You have received 1,000,000 Gold." 1

[@StdModeFunc(61)]
#IF
checkgold 495000001
#SAY
You cannot Exchange goldbarbundle into money.\
your bankbalance would exceed its limit.\ \
<Cancel/@exit>
#ACT
GIVE GoldBarBundle 1
BREAK
#ELSEACT
give gold 5000000
SENDMSG "You have received 5,000,000 Gold." 1

[@StdModeFunc(62)]
#IF
checkgold 490000001
#ACT
GIVE GoldChest 1
SENDMSG "You cannot Exchange balance would exceed its limit." 1
BREAK
#ELSEACT
give gold 10000000
SENDMSG "You have received 10,000,000 Gold." 1
 
Upvote 0

timesplitter

Dedicated Member
Dedicated Member
Dec 11, 2010
88
0
32
Those are good starting point but there is no gold checks, if you dont want players to lose gold you must use checks.

[@StdModeFunc(60)]
#IF
checkgold 499000001
#SAY
You cannot Exchange goldbar into money.\
your bankbalance would exceed its limit.\ \
<Cancel/@exit>
#ACT
GIVE GoldBar 1
BREAK
#ELSEACT
give gold 1000000
SENDMSG "You have received 1,000,000 Gold." 1

[@StdModeFunc(61)]
#IF
checkgold 495000001
#SAY
You cannot Exchange goldbarbundle into money.\
your bankbalance would exceed its limit.\ \
<Cancel/@exit>
#ACT
GIVE GoldBarBundle 1
BREAK
#ELSEACT
give gold 5000000
SENDMSG "You have received 5,000,000 Gold." 1

[@StdModeFunc(62)]
#IF
checkgold 490000001
#ACT
GIVE GoldChest 1
SENDMSG "You cannot Exchange balance would exceed its limit." 1
BREAK
#ELSEACT
give gold 10000000
SENDMSG "You have received 10,000,000 Gold." 1

used this as it did all gold bar types (bar, bundle chest) double click g bar and nothing happens, with bar bundle and chest they disapear but no cash :S
 
Upvote 0

IceMan

Hero's Act Mir 2
Legendary
Apr 17, 2003
8,544
2
370
350
did you setup the fld annicout in db to match this?

i tested these work fine
 
Upvote 0

Anonlol

LOMCN Veteran
Veteran
Feb 25, 2010
574
14
104
You need a reboot to apply the new stdmodes. Reloading the item db will create the items and make them clickable but wont alter the stdmode effects you changed.
 
Upvote 0