More scripting help.

Anonlol

LOMCN Veteran
Veteran
Feb 25, 2010
574
14
104
Because its being really stupid. From memory;

Code:
#if
checkitem rustedbrace(s)
#act
goto check1
#elsesay
Not the correct items!
 
[@check1]
#act
take rustedbrace(s)
take gold 20000
#if
random 30
#act
give DemiseBrace
#elseact
Sendmsg 6 "The item was destroyed"

I did this script last night, anyone can click on the NPC without having the item.. it takes the gold, and displays the message the item was destroyed. Its like its not even doing the first check to see if the player has the item and just skipping to the second part.

I'll take another look tonight but am I doing something stupidly worng on something so simple?
 

hustler

Banned
Banned
Veteran
Jun 6, 2009
570
30
115
[@main]
#IF
checkitem rustedbrace(s) 1
#ACT
goto @check1
#ELSESAY
Not the correct items!\ \
<Exit/@exit>

[@check1]
#ACT
take rustedbrace(s) 1
take gold 20000
#IF
random 30
#ACT
give DemiseBrace 1
#ELSEACT
Sendmsg 6 "The item was destroyed."

Try this.

h
 
Upvote 0

mStation

Golden Oldie
Golden Oldie
Oct 29, 2003
2,042
69
235
♫♪♫ ♦♥♠♣ ♀♂♀
i guess it would be something like this:

[@main]
#if
CHECKITEM RustedBrace(s) 1
#act
goto check1
#elsesay
Not the correct items!

[@check1]
#if
random 30
#act
TAKE RustedBrace(s) 1
TAKE gold 20000
GIVE DemiseBrace 1
#elseact
TAKE RustedBrace(s) 1
TAKE gold 20000
Sendmsg 6 "The item was destroyed"
 
Upvote 0

Bon

Legend
Legendary
Jul 29, 2004
6,741
342
330
Kent, UK
Code:
#IF
checkitem rustedbrace(s) 1
#ACT
goto @check1
break
#ELSESAY
You do not have the correct item, sorry!\ \
<Back/@main>
 
[@check1]
#IF
CHECKGOLD 20000
#ACT
goto @check2
break
#ELSESAY
Sorry you do not have enough gold...\ \
<Back/@main>


[@check2]
#IF
RANDOM 30
#ACT
take rustedbrace(s) 1
take gold 20000
Sendmsg 6 "The item was destroyed... Bad luck!"
break
#SAY
It appears the item has broke.. Im sorry\ \ \
<Back/@main>

#ELSEACT
take rustedbrace(s) 1
take gold 20000
give DemiseBrace 1
Sendmsg 6 "The item crafting was a success!! Enjoy your new item!"
#SAY
The item crafting was a success!! Enjoy your new item!\ \









thats the correct way to do it, the rest of the scripts posted havnt even checked for the gold... of course u could shorten it by just doing this

Code:
#IF
checkitem rustedbrace(s) 1
CHECKGOLD 20000
#ACT
goto @check1
break
#ELSESAY
You do not have the correct item, or enough gold, sorry!\ \

[@check1]
#IF
RANDOM 30
#ACT
take rustedbrace(s) 1
take gold 20000
#SAY
It appears the item has broke.. Im sorry\ \ \
<Back/@main>

#ELSEACT
take rustedbrace(s) 1
take gold 20000
give DemiseBrace 1
#SAY
The item crafting was a success!! Enjoy your new item!\
 
Upvote 0

Anonlol

LOMCN Veteran
Veteran
Feb 25, 2010
574
14
104
Cheers, fixed, all I needed to do was add the 1s, was assuming that if I didnt specify an amount itd default to 1 anyways
 
Upvote 0

Anonlol

LOMCN Veteran
Veteran
Feb 25, 2010
574
14
104
I ried it like that the first time, it didnt work so I broke it all up.

It works, so im happy, its only me thats going to see it :p
 
Upvote 0