The one you gave to drzchulo973.
Giant's Knife/Razor Sword Item Script?
Started by
Dawnlight
, Nov 08 2008 06:08 PM
18 replies to this topic
#16
Posted 10 November 2008 - 10:41 PM
#17
Posted 11 November 2008 - 12:23 AM
Since there are not any global scripts involved, you can just copy and paste one to the end of the other.
CODE
int SwingCounter;
item script RazorSwordPickup{
void run(){
SwingCounter = 0;
}
}
item script RazorSwordAction{
void run(int MaxSwings, int Remove, int M){
SwingCounter++;
if(SwingCounter == MaxSwings){
Link->Item[Remove] = false;
Screen->Message(M);
}
}
}
item script SFX{
void run(int a, int b, int c){
int x = Rand(3);
if(x == 2) Game->PlaySound(a);
if(x == 1) Game->PlaySound(b);
if(x == 0) Game->PlaySound(c);
}
}
item script RazorSwordPickup{
void run(){
SwingCounter = 0;
}
}
item script RazorSwordAction{
void run(int MaxSwings, int Remove, int M){
SwingCounter++;
if(SwingCounter == MaxSwings){
Link->Item[Remove] = false;
Screen->Message(M);
}
}
}
item script SFX{
void run(int a, int b, int c){
int x = Rand(3);
if(x == 2) Game->PlaySound(a);
if(x == 1) Game->PlaySound(b);
if(x == 0) Game->PlaySound(c);
}
}
Edited by Elmensajero, 11 November 2008 - 12:28 AM.
#18
Posted 11 November 2008 - 06:56 AM
Actually, no you can't.
We can only have one action script and one pickup script per item currently I'm afraid =(
The sfx arguments are in order after the razor sword ones.
We can only have one action script and one pickup script per item currently I'm afraid =(
CODE
int SwingCounter;
item script RazorSwordPickup{
void run(){
SwingCounter = 0;
}
}
item script RazorSwordAction{
void run(int MaxSwings, int Remove, int M, int a, int b, int c){
SwingCounter++;
if(SwingCounter == MaxSwings){
Link->Item[Remove] = false;
Screen->Message(M);
}
int x = Rand(3);
if(x < 1) Game->PlaySound(a);
else if(x < 2) Game->PlaySound(b);
else Game->PlaySound(c);
}
}
item script RazorSwordPickup{
void run(){
SwingCounter = 0;
}
}
item script RazorSwordAction{
void run(int MaxSwings, int Remove, int M, int a, int b, int c){
SwingCounter++;
if(SwingCounter == MaxSwings){
Link->Item[Remove] = false;
Screen->Message(M);
}
int x = Rand(3);
if(x < 1) Game->PlaySound(a);
else if(x < 2) Game->PlaySound(b);
else Game->PlaySound(c);
}
}
The sfx arguments are in order after the razor sword ones.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users