Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the 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.
Post Reply
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: 18

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

User avatar
Hamurlik
Fighter
Fighter
Posts: 40
Joined: Mon Aug 06, 2018 4:11 am
Title: Playing SFD is cool 7u7
SFD Account: Hamurlik
SFD Alias: Hamurlik
Started SFD: 1.8.4
Gender:

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: 461
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 20

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

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests