Thread: [Tutorial] Hack Tutorials: Scripting
View Single Post
  #140    
Old December 14th, 2007, 05:31 AM
thethethethe
Gym Leader
 
Join Date: Jun 2007
Location: Melbourne, Australia
Gender: Male
Quote:
Originally Posted by Jvg View Post
What is wrong with this script? every time I try to compile it says:

Code:
Run-time error 457

This Key is already associated with an element of this collection
Script:

Code:
#org $script
checkflag 0x215
if 1 goto $klaar
lock
applymovement 1 $help
$help 1 ; #binary 0x04 0x62 0xFE
pausemove 0
message $bang
$bang 1 =I am scared!\nThat guys won't let me through!
callstd 6
applymovement 0xFF $heen
pausemove 0
applymovement 2 $jij
applymovement 3 $jij1
pausemove 0x50
trainerbattle 1 0x002 $before $after $further
release
end

#org $further
applymovement 2 $bang
pausemove 0
applymovement 3 $kom
pausemove 0
applymovement 2 $gas
pausemove 0
trainerbattle 1 0x003 $voor $na $einde
release
end

#org $einde
message $weg
$weg 1 =You've won.\nYou can pass.
callstd 6
applymovement 3 $gaat1
pausemove 0
setflag 0x215
release
end

#org $heen
$heen 1 ; #binary 0x13 0x13 0x13 0x13 0xFE

#org $jij
$jij 1 ; #binary 0x02 0x65 0xFE

#org $jij1
$jij1 1 ; #binary 0x02 0x65 0xFE

#org $bang
$bang 1 ; #binary 0x65 0x49 0xFE

#org $gas
$gas 1 ; #binary 0x13 0x13 0x13 0x13 0x10 0x10 0x10 0x10 0x10 0x10 0x13 0x60 0xFE

#org $kom
$kom 1 ; #binary 0x10 0x02 0xFE

#org $before
$before 1 =Get out!

#org $after
$after 1 =I lost from a child!

#org $voor
$voor 1 =You won't defeat me!

#org $na
$na 1 =How...

#org $gaat1
$gaat1 1 ; #binary 0x13 0x13 0x13 0x13 0x13 0x10 0x10 0x10 0x10 0x10 0x10 0x13 0x60 0xFE

#org $klaar
release
end
You should have posted this in the script Discussion thread, that's what it's there for. But I've bolded the problem.
You've overused the $bang pointer. Change one of them to something different. The script is confused and doesn't know which pointer to go to, the pointer for the message or the pointer for the applymovement.
__________________
Gone.