This forum is locked and will eventually go offline. If you have feedback to share you can find us in our Discord channel "MythoLogic Interactive" https://discord.gg/nECKnbT7gk

Forum rules

Players die and explosive

Share questions, scripts and tutorials related to the ScriptAPI in SFD.
Forum rules
By using the forum you agree to the following rules.
Locked
Chees
Meatbag
Posts: 7
Joined: Sat Mar 18, 2017 10:02 am
Title: Meetbag
SFD Account: SuperCaptain
SFD Alias: [police]Chees
Started SFD: PreAlpha 1.3.1b
Location: VietNam
Gender:
Age: 25

Players die and explosive

Post by Chees » Wed May 24, 2017 10:43 am

I wonder if the player die and explosive.How can i do that
pls help me.Thx :D
0 x

User avatar
UnluckyNinja
Meatbag
Posts: 7
Joined: Sun Aug 07, 2016 11:30 am
Gender:

Post by UnluckyNinja » Wed May 24, 2017 8:22 pm

You need an OnPlayerDeathTrigger, then in the script:
If you just want visual effects: player.Gib();
If you want damage to other players: Game.CreateExplosive(var).
(Didn't check the spell, better look them up in the doc.)
0 x

Hamurlik
Fighter
Fighter
Posts: 49
Joined: Mon Aug 06, 2018 4:11 am

Post by Hamurlik » Wed Mar 06, 2019 2:28 pm

UnluckyNinja wrote:
Wed May 24, 2017 8:22 pm
You need an OnPlayerDeathTrigger, then in the script:
If you just want visual effects: player.Gib();
If you want damage to other players: Game.CreateExplosive(var).
(Didn't check the spell, better look them up in the doc.)
Where exactly to enter the script for OnPlayerDeathTrigger?
0 x

User avatar
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 27

Post by JakSparro98 » Wed Mar 06, 2019 7:46 pm

Chees wrote:
Wed May 24, 2017 10:43 am
I wonder if the player die and explosive.How can i do that
pls help me.Thx :D
Do you need that the player explodes in giblets or a normal explosion like the one we see from a red barrel?

Hamurlik wrote:
Wed Mar 06, 2019 2:28 pm
UnluckyNinja wrote:
Wed May 24, 2017 8:22 pm
You need an OnPlayerDeathTrigger, then in the script:
If you just want visual effects: player.Gib();
If you want damage to other players: Game.CreateExplosive(var).
(Didn't check the spell, better look them up in the doc.)
Where exactly to enter the script for OnPlayerDeathTrigger?
You need to specify a method name inside the Script Method field of the OnPlayerDeathTrigger.
Image
the method name refers to a public method inside the map script.

Code: Select all

public void MyMethod(TriggerArgs arg)
{

//code

}
0 x

Locked