My first NPC Script...

IceSlice

Golden Oldie
Golden Oldie
May 24, 2005
1,186
58
155
Under the Sea :O
[@Main]
#IF
checkgold 1000
#SAY
Ah, i see your still a noob o well i best give u some money
to help you a long the way, here you go.
#ELSESAY
Im afraid you have already got your gold bar now be on your way please.
#IF
checkitem goldbar 1
#ACT
checkgold 999
<Ok bye/@exit>\

if theres anything wrong as its my first time give me some pointers please thanks :D
 
Last edited:

Hazuki

VIP
VIP
Apr 14, 2004
3,459
38
285
United Kingdom
If some has 1050 gold with your current code they willl get a goldbar, change it to:
CHECKGOLD > 999

You have said the player has already got a gold bar, but where have you checked for it?
#ELSESAY
Im afraid you have already got your gold bar now be on your way please.

There is no @gotgoldbar for the script to load.

/Haz
 

IceSlice

Golden Oldie
Golden Oldie
May 24, 2005
1,186
58
155
Under the Sea :O
[@Main]
#IF
checkgold 1000
#SAY
Ah, i see your still a noob o well i best give u some money
to help you a long the way, here you go.
#ELSESAY
Im afraid you have already got your gold bar now be on your way please.
#IF
checkitem goldbar 1
#ACT
checkgold 999

<Ok bye/@exit>\

ok so just them then? :P im a nub at this lol.
 

Far

tsniffer
Staff member
Developer
May 19, 2003
20,229
30
2,820
540
no. thats totally wrong lol. here..

[@Main]
#IF
CHECK [555] 1
#SAY
Im afraid you have already got your gold bar now be on your way please.
<Ok bye/@exit>\
#ELSESAY
Ah, i see your still a noob o well i best give u some money
to help you a long the way, here you go.
<Ok bye/@exit>\
#ELSEACT
set [555] 1
give goldbar 1
 

GhettoFx

Runescape HD
Golden Oldie
May 17, 2005
920
0
122
gd for ur first attempt if u need any help on npc speak to me i'll help u out
 

Far

tsniffer
Staff member
Developer
May 19, 2003
20,229
30
2,820
540
checknamelists work exactly the same just require 100's of txt files. why confuse him anymore when hes already having trouble with #IF statements.
 
Last edited:

MentaL

Mir 1.4
VIP
Mar 3, 2004
3,682
379
375
Cardiff
LOOK!!!! Heres a simple way of doing it

[@main]
#IF
checkgold x
#ACT
take gold x
goto @1
#ELSEACT
goto @2

or

[@main]
#IF
checknamelist list.txt
#ACT
goto @1
#ELSEACT
goto @2

[@1]
#IF
checkgold x
#ACT
take gold x
goto @x
#ELSEACT
goto @x


;)
 

Mystickiller

Bored AF
Golden Oldie
Dec 24, 2003
1,007
4
194
Minnesota, USA
checknamelists work exactly the same just require 100's of txt files. why confuse him anymore when hes already having trouble with #IF statements.


personally think there easy enough to get used to.

problem with flags is they can be exploited, and you also need to remembe what flags are used for what, if you arrange your quest folder around properly (i know most major servers do, i did i had around 100 different folders full of txt's back in the day) its alot easier to use / get the hang of / keep track off.
 

Fire

Golden Oldie
Golden Oldie
Apr 15, 2003
1,302
1
195
flags cant be exploited unless you make a sloppy npc script or keep undocumented notes for your npcs. but since there is a limit on the number of flags namelists are better in some circumstances (ie when you dont want to use mapquest)

anyway the best version of the npc to use is mentals and just fill in the blanks