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.

Any way to check what weapon the player is holding?

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Post Reply
User avatar
Ol1vver
Superfighter
Superfighter
Posts: 69
Joined: Mon Nov 19, 2018 4:55 pm
SFD Account: olv
SFD Alias: olv
Started SFD: PreAlpha 1.6.4
Gender:

Any way to check what weapon the player is holding?

Post by Ol1vver » Wed Jan 02, 2019 2:21 pm

Hello,
Is there a way to check what weapon the player is holding? I need that for my map.
For example:
A player needs to hold an axe to break a barricade (using ActivateTrigger)
0 x

User avatar
Sree
Superfighter
Superfighter
Posts: 325
Joined: Sun May 08, 2016 8:19 pm
SFD Account: phasmic
SFD Alias: sree
Gender:
Age: 23

Post by Sree » Wed Jan 02, 2019 4:08 pm

Just go through the API Documentation please, If you feel like you didn't understand something in the documentation then learn C#
1 x

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

Post by Gurt » Wed Jan 02, 2019 5:44 pm

Check the API documentation for SFD. You can find in in the script window by pressing "Script API (F1)".
1 x
Gurt

User avatar
Ol1vver
Superfighter
Superfighter
Posts: 69
Joined: Mon Nov 19, 2018 4:55 pm
SFD Account: olv
SFD Alias: olv
Started SFD: PreAlpha 1.6.4
Gender:

Post by Ol1vver » Wed Jan 02, 2019 8:09 pm

Gurt wrote:
Wed Jan 02, 2019 5:44 pm
Check the API documentation for SFD. You can find in in the script window by pressing "Script API (F1)".
Sree wrote:
Wed Jan 02, 2019 4:08 pm
Just go through the API Documentation please, If you feel like you didn't understand something in the documentation then learn C#
Thanks, I already figured it out.
Though it didn't work as I expected - instead the code runs if the player is holding anything else than the weapon I want.
Fixed by using "else".
0 x

User avatar
Sree
Superfighter
Superfighter
Posts: 325
Joined: Sun May 08, 2016 8:19 pm
SFD Account: phasmic
SFD Alias: sree
Gender:
Age: 23

Post by Sree » Wed Jan 02, 2019 8:18 pm

Ol1vver wrote:
Wed Jan 02, 2019 8:09 pm
Though it didn't work as I expected - instead the code runs if the player is holding anything else than the weapon I want.
Fixed by using "else".
If you had any knowledge of the language, You'd know that you could the achieve the same by just making the conditional statement check for false instead of adding an entire else block for it lmao
3 x

Post Reply