I've been trying to make a hitsound script, but for some reason nothing is working. I had it to play when I died but nothing else
-- I am so sorry for this code
game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
local player = game:GetService("Players").LocalPlayer
local char = player.CharacterAdded:wait()
local human = char.Humanoid
repeat wait() until char:FindFirstChild("Humanoid")
local button = script.Parent
local toggled = false
--Dumb Hitsound system
function play()
local Sound = button.hitsound
Sound:Play()
end
wait(1)
repeat
if human.Health < human.MaxHealth
then
button.hitsound.Playing = true
else
button.hitsound.Playing = false
end
until human.Health == 0
