Page 1 of 1
Canon deal no damages
Posted: 14 Apr 2015, 10:28
by Guerro323
Hello, I was trying to create a beautiful canon item, but it's not deal any damages ( Tested with melee scripts and bot. )
So, how can I add damages to the canon ?

Re: Canon deal no damages
Posted: 14 Apr 2015, 13:19
by Eole
Actions don't deal damage by default, you have to manage that yourself in the game mode script. You can read
this to learn how to do it.
Re: Canon deal no damages
Posted: 14 Apr 2015, 13:53
by Guerro323
Eole wrote:Actions don't deal damage by default, you have to manage that yourself in the game mode script. You can read
this to learn how to do it.
I tried with your link, but when I put it on the script, it's work only for me when I shoot a custom weapon, but it's dont write the text when the cannon fire with the custom weapon :/
Re: Canon deal no damages
Posted: 15 Apr 2015, 14:12
by Eole
I'm not sure to understand what you are trying to do. You have a custom weapon, it deals damage when you fire the weapon yourself but not when the cannon fire it. What is this cannon exactly?
Re: Canon deal no damages
Posted: 15 Apr 2015, 14:20
by Guerro323
Eole wrote:I'm not sure to understand what you are trying to do. You have a custom weapon, it deals damage when you fire the weapon yourself but not when the cannon fire it. What is this cannon exactly?
The Cannon item.

Re: Canon deal no damages
Posted: 21 Apr 2015, 09:52
by Teardrop
Hi,
By default, the first parameter of an OnActionCustomEvent, created by a cannon is "cannon" , not "damage".
So you have to use this :
Code: Select all
if(Event.Param1 == "cannon"){
if(Event.Victim != Null){
AddPlayerArmor(Event.Victim, -100, Null, 1);
}
}
PassOn(Event);
You can also modify the action script (by checking the "Custom action" button), if you want it to comport itself like a normal action.
Re: Canon deal no damages
Posted: 21 Apr 2015, 10:14
by Guerro323
Teardrop wrote:Hi,
By default, the first parameter of an OnActionCustomEvent, created by a cannon is "cannon" , not "damage".
So you have to use this :
Code: Select all
if(Event.Param1 == "cannon"){
if(Event.Victim != Null){
AddPlayerArmor(Event.Victim, -100, Null, 1);
}
}
PassOn(Event);
You can also modify the action script (by checking the "Custom action" button), if you want it to comport itself like a normal action.
Oh thanks, it's work
