Basically, I’m working on making a equipped light source play a sound when equipped and then stop the sound when unequipped.
I thought it would be simple enough to put the sound into a part of the tool, which it was, however, whenever you unequip the tool the sound continues to play where the tool was unequipped.
The code I have is as follows and is placed in the tool as a local script… I’m not sure what I’m doing wrong.
local player = game:GetService("Players").LocalPlayer
local tool = script.Parent
local Sound = script.Parent.Head.Sound.Volume
tool.Equipped:Connect(function()
print(player.Name.." has equipped a torch.")
Sound = 0.2
end)
tool.Unequipped:Connect(function()
print(player.Name.." is unequipped a torch.")
Sound = 0
end)