I have tried on various different days and dont know whats wrong. Script: game.players.playeradded:connect(function(player) player.characteradded:connect(function(char) local sound = game.ServerStorage.Punch:Clone() sound.parent = char:waitforchild("head") end) end)
game.ReplicatedStorage.Punch.OnServerEvent:Connect(function(player, humanoid) if humanoid.health >= 10 then humanoid.health = humanoid.health - 10 elseif humanoid.health < 10 then humanoid.health = 0 end
player.character.head.punch:play()
end)
Try this:
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) local sound = game.ServerStorage.Punch:Clone() sound.parent = char:WaitForChild("Head") end) end) game.ReplicatedStorage.Punch.OnServerEvent:Connect(function(player, humanoid) if humanoid.health >= 10 then humanoid.health = humanoid.health - 10 elseif humanoid.health < 10 then humanoid.health = 0 end player.Character.Head.punch:play() end)