Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Is there a way to add 2 different SFX to weapons? (click for better desc)


Waffle
 Share

Recommended Posts

ok, im making a new game, and i have 2 different weapons, a laser pistol, and light-sword (like lightsaber from star wars)… well i need them to have 2 different SFX... but they both use "sword.wav" can anyone help?
Link to comment
Share on other sites

Replace Sword.wav with an empty file, and script the sounds, like so:

```
If GetPlayerWeaponSlot(index) > 0 Then
    Select Case GetPlayerInvItemNum(index, GetPlayerWeaponSlot(index))
        Case SwordItemNum
            Call PlaySoundToMap(GetPlayerMap(index), "SwordSound.wav")
        Case PistolItemNum
            Call PlaySoundToMap(GetPlayerMap(index), "PistolSound.wav")
    End Select
End If
```You'd just throw that into your OnAttack sub and you're good to go. Just change the SwordItemNum and such and the sound files and it'll work.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...