script to spawn alternate boss if player is using determined character

rafhot

Member
hi i need to create one scirpt to
check if p1, p2, p3 or p4
are using the playable character "Namor"

and if is there someone playing with him
instead to spawn the boss with the same name other boss character will be spawned "Llyron"

where i should put one script like this?
 
Variable in namor spawn animation set to 1, then reset variable in his death animation.
Then script in level to check if variable namor is 1 and spawn boss entity according to it.
 
i never did one script in the level yet, its juts like  code inside animations?
like:
@script
.....

@end_script

can i put it anywhere in the stage1.txt? or i need to do any other thing like spawn anything to deal with the code
 
no, directly when you spawn Namor

spawn Namor
@script void main() {
  *PUT YOUR CODE HERE*
} @end_script
coords 400 165
at 0
 
Or just spawn both boss characters and create script in their spawn animation to check variable so if its 1 then kill character immediately
 
Nah, why bother setting variable, just check all player's name then kill or not kill if Namor is played or not.

Rough idea:

spawn  Namor
@script void main() {
//Check all players's name, if one of them is Namor, run killentity function
} @end_script
coords  400 165
at 0

spawn  Llyron
@script void main() {
//Check all players's name, if none of them is Namor, run killentity function
} @end_script
coords  400 165
at 0
 
Back
Top Bottom