Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with my sword script?

Asked by
steev 0
9 years ago

I have edited the sounds for the classic roblox sword.

The sounds play perfectly when i unsheath the sword and start to lunge it as normal. All i need now is to add a sheath sound so when you put the sword away it plays a sound.

local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "http://www.roblox.com/asset/?id=210946558"
SlashSound.Parent = sword
SlashSound.Volume = .7

local LungeSound = Instance.new("Sound")
LungeSound.SoundId = "http://www.roblox.com/asset/?id=210946558"
LungeSound.Parent = sword
LungeSound.Volume = .6

local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "http://www.roblox.com/asset/?id=210933582"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1

Any help would be appreciated.

Thank you.

1 answer

Log in to vote
0
Answered by 9 years ago

All sounds have a PlayOnRemove propety, if you check it the sound will play when you unequip the tool. No scripting required.

Ad

Answer this question